Skip to content

Commit 2a3d2d3

Browse files
authored
Merge pull request #97 from oracle/fix/nor1-postman-collection
Corrected the OCIM getOAuthToken request in the NOR1 collection
2 parents c33106b + ddffa77 commit 2a3d2d3

File tree

1 file changed

+48
-25
lines changed

1 file changed

+48
-25
lines changed

postman-collections/nor1/oracle-hospitality-nor1-upgrade.postman_collection.json

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"info": {
3-
"_postman_id": "ef882897-a02c-431c-8942-7827cbbc5023",
3+
"_postman_id": "8610de20-dee0-4057-af83-78de074d0531",
44
"name": "4. Nor1 Upgrade REST APIs",
55
"description": "APIs to cater for Nor1 eXpress Upgrades\n\nOracle’s Nor1 eXpress Upgrade allows hotels and resorts to present confirmed room upsell offers to guests before arrival, allowing the hotel to monetize inventory and avoid oversold conversations at check-in. Nor1 eXpress Upgrade offers allows instant fulfillment of the offer and updates the reservation in OPERA Cloud in real time.\n\nFor further detailed information on Nor1 eXpress, please refer to the eXpress User Guide located [here](https://docs.oracle.com/en/industries/hospitality/nor1-cloud/norug/ch_express_upgrades.htm#EXpressUpgrades-95A131F1).",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
7-
"_exporter_id": "15729853",
8-
"_collection_link": "https://hospitalityapis.postman.co/workspace/Team-Workspace~f6e529a2-8cdb-43d1-8526-1aa5d61f48e4/collection/15729853-ef882897-a02c-431c-8942-7827cbbc5023?action=share&source=collection_link&creator=15729853"
7+
"_exporter_id": "44991951"
98
},
109
"item": [
1110
{
@@ -63,14 +62,13 @@
6362
"header": [
6463
{
6564
"key": "Content-Type",
66-
"name": "Content-Type",
67-
"type": "text",
68-
"value": "application/x-www-form-urlencoded"
65+
"value": "application/x-www-form-urlencoded",
66+
"type": "text"
6967
},
7068
{
7169
"key": "x-app-key",
72-
"type": "text",
73-
"value": "{{AppKey}}"
70+
"value": "{{AppKey}}",
71+
"type": "text"
7472
},
7573
{
7674
"key": "enterpriseId",
@@ -129,16 +127,37 @@
129127
"var uuid = require('uuid');\r",
130128
"var myUUID = uuid.v4();\r",
131129
"pm.environment.set(\"MyGUID\", myUUID);\r",
132-
"pm.environment.set(\"HashedAppKey\", CryptoJS.SHA256(pm.environment.get(\"AppKey\")).toString());"
130+
"(async () => {\r",
131+
" const encoder = new TextEncoder();\r",
132+
" const data = encoder.encode(pm.environment.get(\"AppKey\"));\r",
133+
" \r",
134+
" const hashBuffer = await crypto.subtle.digest(\"SHA-256\", data);\r",
135+
" const hashArray = Array.from(new Uint8Array(hashBuffer));\r",
136+
" const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');\r",
137+
" \r",
138+
" pm.environment.set(\"HashedAppKey\", hashHex);\r",
139+
"})();\r",
140+
""
133141
],
134-
"type": "text/javascript"
142+
"type": "text/javascript",
143+
"packages": {}
135144
}
136145
}
137146
],
138147
"request": {
139148
"auth": {
140149
"type": "basic",
141150
"basic": [
151+
{
152+
"key": "password",
153+
"value": "{{CLIENT_SECRET}}",
154+
"type": "string"
155+
},
156+
{
157+
"key": "username",
158+
"value": "{{CLIENT_ID}}",
159+
"type": "string"
160+
},
142161
{
143162
"key": "undefined",
144163
"type": "any"
@@ -149,32 +168,36 @@
149168
"header": [
150169
{
151170
"key": "Content-Type",
152-
"name": "Content-Type",
153-
"type": "text",
154-
"value": "application/x-www-form-urlencoded"
171+
"value": "application/x-www-form-urlencoded",
172+
"type": "text"
155173
},
156174
{
157175
"key": "x-app-key",
158-
"type": "text",
159-
"value": "{{AppKey}}"
176+
"value": "{{AppKey}}",
177+
"type": "text"
178+
},
179+
{
180+
"key": "enterpriseId",
181+
"value": "{{EnterpriseId}}",
182+
"type": "text"
183+
},
184+
{
185+
"key": "X-Request-Id",
186+
"value": "{{$guid}}",
187+
"type": "text"
160188
}
161189
],
162190
"body": {
163191
"mode": "urlencoded",
164192
"urlencoded": [
165193
{
166-
"key": "username",
167-
"value": "{{Username}}",
168-
"type": "text"
169-
},
170-
{
171-
"key": "password",
172-
"value": "{{Password}}",
194+
"key": "grant_type",
195+
"value": "client_credentials",
173196
"type": "text"
174197
},
175198
{
176-
"key": "grant_type",
177-
"value": "password",
199+
"key": "scope",
200+
"value": "urn:opc:hgbu:ws:__myscopes__",
178201
"type": "text"
179202
}
180203
]
@@ -190,7 +213,7 @@
190213
"tokens"
191214
]
192215
},
193-
"description": "Use this API to request an oAuth token when the environment is a Client Credentials environment. You can see which oAuth flow an environment supports by looking at the Environment page in the OHIP Developer Portal. For more information see (Authenticating to Oracle Hospitality Property APIs)\\[[https://docs.oracle.com/en/industries/hospitality/integration-platform/ohipu/c_oracle_hospitality_property_apis.htm#AuthenticatingToOracleHospitalityPr-1BD54F80](https://docs.oracle.com/en/industries/hospitality/integration-platform/ohipu/c_oracle_hospitality_property_apis.htm#AuthenticatingToOracleHospitalityPr-1BD54F80)\\] under the heading \"Client Credentials-Based Authentication\".\n\nTo call this API you will need:\n\n1. To know the environment is a Client Credentials environment - see above\n2. A valid ClientId and ClientSecret\n3. A valid EnterpriseId\n \n4. A valid application key\n \n\nBecause of this, oAuth tokens may only be used when calling the given environment.\n\noAuth tokens expire after 60 minutes. We recommend obtaining a new oAuth token every 50 minutes, but not more frequently."
216+
"description": "Use this API to request an oAuth token when the environment is a Client Credentials environment. You can see which oAuth flow an environment supports by looking at the Environment page in the OHIP Developer Portal. For more information see (Authenticating to Oracle Hospitality Property APIs)\\[[https://docs.oracle.com/en/industries/hospitality/integration-platform/ohipu/c_oracle_hospitality_property_apis.htm#AuthenticatingToOracleHospitalityPr-1BD54F80](https://docs.oracle.com/en/industries/hospitality/integration-platform/ohipu/c_oracle_hospitality_property_apis.htm#AuthenticatingToOracleHospitalityPr-1BD54F80)\\] under the heading \"Client Credentials-Based Authentication\".\n\nTo call this API you will need:\n\n1. To know the environment is a Client Credentials environment - see above\n2. A valid ClientId and ClientSecret\n3. A valid EnterpriseId\n4. A valid application key\n \n\nBecause of this, oAuth tokens may only be used when calling the given environment.\n\noAuth tokens expire after 60 minutes. We recommend obtaining a new oAuth token every 50 minutes, but not more frequently."
194217
},
195218
"response": []
196219
}

0 commit comments

Comments
 (0)