Application Key

  1. Create an application in the OHIP Developer Portal,
  2. Hash the application key. See the below 'Hashing the Application Key' section.
  3. Add events to the template, then subscribe it to the environment. For the purposes of this implementation guide, subscribe to the New Profile and
    Update
    Profile
    events.
  4. Ensure the environment owner has approved the subscription. See Working with Events in the Developer Portal in the OHIP user guide where this is described.

    Note:

    The environment owner may approve the consumption of events only from a subset of hotels in the chain.

Hashing the Application Key

The Streaming API requires a SHA256 hash of the application key because it is sent in the URL.

  • If LINUX environments are running, echo -n ABC-123 | sha256sum (where "ABC-123" is the application key) will return the required hash.
  • In Microsoft Windows environments:
    • Use a code snippet that leverages the certificate utility certutil
    • Download GitBash and use the above LINUX command.
    • Install Microsoft Windows Subsystem for Linux and use the above LINUX command.
    • Use an online sha256 hash generator.
  • Ensure only lowercase hashes are used.

App Key Scope and Multi-Chain Connections

The application key identifies your application and is not limited to a single chain, provided that both of the following are true for each target chain:

  • The partner has configured the application's event subscriptions for that chain in the Developer Portal.
  • The environment owner (customer) has approved those subscriptions.

If the above conditions are true, the same application key may be used to maintain concurrent WebSocket connections to different chains.

Example: You may connect to chain A using chain A credentials with appKey1 and, at the same time, connect to chain B using chain B credentials with the same appKey1.

Constraints:

  • The "single consumer per stream" rule still applies per appKey, chainCode, and gateway. Only one active subscriber per chain for that appKey is allowed; a second subscriber to the same chain with the same appKey will be rejected (4409).
  • Each connection must present an OAuth token valid for its target chain/environment (tokens are not interchangeable across chains).
  • Ensure the chainCode in the subscribe payload matches the target chain for that connection.

Note on customer vs partner application scope:

  • Customer-owned applications are scoped to a single chain. To connect to multiple chains, customers must create separate applications (one per chain) under each target chain in the OHIP Developer Portal; each application will have its own app key.
  • Partner-owned applications may be used across multiple customer chains (subject to configuring subscriptions in the Developer Portal and obtaining each customer's approval), enabling concurrent connections to different chains with the same app key.