Subscribing and Consuming Events
Scenario: A hotel chain wants to integrate its property management system (PMS) with a customer relationship management (CRM) platform to ensure that any updates to reservations or guest profiles in OPERA Cloud are immediately reflected in the CRM.
Conceptual Flow:
- Subscription Initiation: The CRM system establishes a WebSocket connection to the OHIP Streaming API and subscribes to relevant business events, such as Update Reservation and Update Profile events to monitor updates to reservations and guest profiles.
- Event Emission: When a reservation is created, modified, or canceled in OPERA Cloud, or a profile is updated, the Streaming API emits the corresponding event.
- Event Consumption: The CRM system receives the event in real-time and updates
its records accordingly, ensuring data consistency across platforms.
deltafiltering and GET orchestration patterns are available.
Figure 4-1 Flow Diagram

In summary:
- Connect to the following:
wss://gateway/subscriptions?key=SHA256(app_key) - Set Sec-WebSocket-Protocol: graphql-transport-ws.
- Send connection_init with OAuth Bearer token in payload.
- After connection_ack, send subscribe.
- Consumption occurs via
nextmessages with offset included for ordering. - Consumption stops after the server sends the last messages in response to the client
sending the
completemessage.
Quick Smoke Test (UAT or sandbox):
- Ensure your application is subscribed and approved for "New Profile" and/or "Update Profile."
- Start your consumer, wait for
connection_ack, and then sendsubscribe. - From Postman (see Postman collections), perform a simple REST write that emits a Business Event (for example, create a new profile).
- Confirm a
nextmessage arrives with eventName "NEW PROFILE" (or "UPDATE PROFILE") and aprimaryKey. Optionally, orchestrate a GET usingprimaryKeyto verify the current state.
Parent topic: Overview of Streaming API