This guide explains how vendors (IPTV, Wifi, Key Card) can integrate with the Hospitality PMS WebSocket (WSS) platform to receive real-time guest and room events.
Vendor Application (IPTV, Wifi, Key Card) → OAuth 2.0 Token Endpoint → WebSocket Server (/subscriptions) → Real-time PMS Events → Vendor Application (IPTV, Wifi, Key Card)
Vendors must obtain an OAuth 2.0 access token using the Client Credentials flow. Tokens are scoped per enterprise and expire after 60 minutes.
After establishing a WebSocket connection, the client must immediately send
a connection_init message with the access token and app key.
Subscriptions are created per property(s) (chainCode).
Unauthorized chain codes are rejected server-side.
curl --location 'https://destinity-wss.azurewebsites.net/oauth/v1/tokens' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic <base64(clientId:clientSecret)>' \
--header 'x-app-key: APPKEY001' \
--header 'enterpriseId: BROWNS' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=urn:pms:events'
{
"type": "connection_init",
"payload": {
"Authorization": "Bearer <access_token>",
"x-app-key": "APPKEY001"
}
}
{
"id": "sub-1",
"type": "subscribe",
"payload": {
"query": "subscription { newEvent(input: { chainCode: \"TTE\" }) { metadata { offset } moduleName eventName detail { elementName oldValue newValue } } }"
}
}
An offset is a sequence number assigned to each event by the PMS WebSocket server.
If your vendor application disconnects and reconnects later, it must tell the server where it left off.
Use offset to: Continue from the last processed event.
Avoid missing important guest updates
{
"id": "sub-1",
"type": "subscribe",
"payload": {
"query": "subscription { newEvent(input: { chainCode: \"HTBTTE\" }) { metadata { offset } moduleName eventName detail { elementName oldValue newValue } } }",
"extensions": {
"fromOffset": 42
}
}
}
+------------------------+----------------------+----------------------+----------------------+
| Vendor Application | Token Service | WSS Server | PMS Core |
+------------------------+----------------------+----------------------+----------------------+
| | | | |
| ---- OAuth Token ----> | | | |
| <--- Access Token ---- | | | |
| | | | |
| ------------------------------- Connect (WSS) ---------------------> | |
| | | | |
| ---- connection_init (JWT) ----> | | |
| <--- connection_ack ---------- | | |
| | | | |
| ---- subscribe (chainCode) ---> | | |
| <--- event (GuestCheckedIn) --- <-- PMS Event | | |
| | | | |
| ---- ping --------------------> | | |
| <--- pong -------------------- | | |
| | | | |
+------------------------+----------------------+----------------------+----------------------+
All authorization is enforced via JWT claims. Chain codes are validated per subscription request.
Offsets are monotonically increasing per chain code and can be used for replay or recovery scenarios.
Each client is restricted to its allowed propertie(s) using chain code. Single chain code can have access to multiple properties. Property mapping to chain code will done from the service configuration.
Connection lifecycle, subscriptions, and event delivery are logged for auditing and diagnostics.
curl --location 'https://destinity-wss.azurewebsites.net/oauth/v1/tokens' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic Y2xpZW50LWFwcC0wMDE6c2VjcmV0LTAwMQ==' \
--header 'x-app-key: APPKEY001' \
--header 'enterpriseId: BROWNS' \
--header 'X-Request-Id: 7f2a1a36-2e41-4b62-9d4f-5cfa8c1b52b2' \
--header 'Cookie: ARRAffinity=f4edef8e8ae33d792aa347f6380e743b9805a4dd08725995c30ae1f829052383; ARRAffinitySameSite=f4edef8e8ae33d792aa347f6380e743b9805a4dd08725995c30ae1f829052383' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=urn:pms:events'
URL :
wss://destinity-wss.azurewebsites.net/subscriptions?key=QVBQS0VZMDAx
{
"type": "connection_init",
"payload": {
"Authorization": "Bearer <access_token>",
"x-app-key": "APPKEY001"
}
}
{
"id": "JlMGVmLTZhYWMtNDJlOC1iNWFmL",
"type": "subscribe",
"payload": {
"query": "subscription { newEvent(input: { chainCode: \"TTE\" }) { metadata { offset } moduleName eventName detail { oldValue newValue elementName } } }"
}
}
{
"type": "ping"
}
{
"id": "JlMGVmLTZhYWMtNDJlOC1iNWFmL",
"type": "complete"
}
Contact : Team Destinity Inspire
Email : sachithk@scienter.lk
Phone : +94 71 999 2193