OAuth Token API
All Oracle Hospitality Data APIs expect the following mandatory headers:
- Token: A header “Authorization” that includes the oAuth token obtained through Authenticating to Oracle Hospitality APIs.
- Application key: A unique application key is created for each application upon registering an application in the Oracle Hospitality Developer Portal. This key must be passed in the “x-app-key” header of every request to the Oracle Hospitality APIs. To obtain your application key, refer to Viewing the Application Key.
- Accept: This must be “multipart/mixed; deferSpec=20220824, application/json” so that data will be sent back to the consumer as chunks.
Required Headers
- x-app-key:<ApplicationKey>
- Authorization: Bearer <oAuth Token>
- Accept: multipart/mixed; deferSpec=20220824, application/json
Optional Headers
- X-Request-Id: This is a GUID that can help Oracle troubleshoot API issues. For more information, refer to X-Request-ID.
The below table lists the environment variables you can add to the Postman Environment.
| Variable | Value |
|---|---|
| AppKey | This value is accessed from the Developer Portal. |
| ClientId | This value is accessed from the Developer Portal. |
| ClientSecret | This value is accessed from the Developer Portal. |
| HotelId | Optional for the Oracle Hospitality Data APIs. This value is supplied by the hotel. |
| EnterpriseId | This value is provided by the customer so that you can add the environment. Subsequently, it can be accessed from the Developer Portal. |
| Scope |
This value is always the following:
|
Sample curl command to request
reservations:
curl --location '<gateway URL> /rna/v1/graphql/' \
--header 'x-app-key: <appKey>' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: multipart/mixed; deferSpec=20220824, application/json' \
--header 'Content-Type: application/json' \
--header 'x-request-id: <GUID>' \
--data '{"query":"query BookingsReservation($input: BookingsReservationQueryArgumentsType!) {\n bookingsReservation(input: $input) {\n reservationDetails {\n arrivalDate\n bookedRoomCategory\n currencyCode\n departureDate\n guestprofileid\n resvNameid\n resvNumber\n }\n reservationStatusDetails {\n reservationStatus\n }\n }\n}","variables":{"input":{"reservationDetailsResort":{"_in":["CTESTPRO"]},"reservationDetailsTruncBeginDate":{"_eq":"2021-07-23"},"reservationDetailsTruncEndDate":{"_gte":"2021-07-01","_lte":"2021-12-31"},"reservationDetailsResvNameId":{"_eq":2216837971}}}}'
Parent topic: Calling the Oracle Hospitality Data APIs