Real-time possibilities in OHIP
OHIP, Oracle Hospitality Integration Platform, is your entry point for accessing information in Opera Cloud.
The OHIP API enables access to any business object and supports real-time event processing. This article will focus on real-time processing. You have two ways of getting business object events from OHIP, - Streaming API or Poll API.
Get your access information
Before you can start working on these APIs you need to access OHIP for your Opera Cloud instance.
Choose "Oracle Hospitality Developer Portal." in the side menu. Click "Environments", and you should see your environment (s).

Screenshots from OHIP portal
Click on “View details” to get Client ID, Client Secret and Gateway URL. To get streaming enabled, you must contact your Oracle Support.
Go back to “Applications” and click “Register Application”.
Streaming API

This API allows you to set up a web socket connection to a GraphQL service, providing real-time updates on business object changes from Opera Cloud. The steps required for this to work are:
-
Create an APP in OHIP. This makes it possible to subscribe to specific business events and hotels (like RESERVATION events in hotel ABC). (BH: Image?)
-
Get APP key from OHIP (BH: How do you get client credentials)
-
Create a web socket client. I recommend starting in Postman or another API tool, so you know that it works. When this work, you create a client in NodeJs, as its very powerful deal with real-time processing. Also see Luis Weir demo at github. OBS: You can only have one client connected to the same OHIP APP.
Payload structure:
Below is the payload structure when requesting events from the Streaming API.
​

Because this is like using Apache Kafka, you have offset and an unique EventId. Offset can be used to decide what payloads to fetch.
Save and use the offset in your Subscribe payload:
​

Read more about the payloads on this page.
​
Poll API

This API is much simpler to begin with at various levels and can be implemented in any programming language, as it uses REST API calls to retrieve events. The steps required for this to work are:
1) Create an APP in OHIP. This makes it possible to subscribe to specific business events and hotels (like NEW PROFILE, RESERVATION events in hotel ABC).
2) Get APP key from OHIP (BH: How do you get client credentials)
3) Create a REST API client. I recommend starting in Postman or another API tool, so you know that it works. When this work, you create a client in any language you want. Create a client in OCI Function, OCI Dataflow (Spark) or maybe using an integration in Oracle Integration Cloud. No limits in this choice.
The payload format received when polling API.

In this payload you don’t have an offset. You will poll for payloads and receive them once!
Read more about the Poll API on this page.
Processing events
For both solutions you need to fetch payload and forward to data lake or something else.
Depending on your subscription settings in OHIP, you will receive a lot of events. I recommend sending payload to OCI Streaming services (Apache Kafka), and then develop consumers as needed.
Using Oracle Cloud, you can setup consumers in OCI Functions, OCI Dataflow (Apache Spark), Oracle Integration Cloud or create your own consumer.

Keys to success:
-
Get Streaming enabled by contacting Oracle Support.
-
Start with Postman. Get all requests to work before starting development.
-
Streaming API: Use Typescript for optimized websocker sockets. You need to implement async functions, so you can recieve payloads in high-speed.
-
Streaming API: Be prepared to run this in a container enviroment.
-
Poll API: This can run as a OCI Function or Integration Cloud. Dont use a server for this
-
Push payloads to an Apacke Kafka service like OCI Streaming Services.
This is a high level overview of the steps needed to get real-time processing to work.
A deep dive article will be published soon!

