3) Querying a user's hotels
The main reason behind querying a user's hotels is to get a hotelId, which is a requirement for getting a Hotel level access token.
You can query a list of hotels from the user document.
query user {
user {
hotels {
id
name
}
}
}
Headers
{
"Authorization": "Bearer {access_token}"
}
Response
[
{
"name": "Elah the Bay",
"id": "628e84be211490d135e186bf"
},
{
"name": "Elah the Hills",
"id": "628e84d78f8dee6828f456b9"
}
]
On your own app you may choose to have a component that asks the user which hotel they are connecting to.
Now you can exchange the refreshToken for an accessToken.