Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loHttp = createobject("CkHttp")
loHttp.SetRequestHeader("Content-Type","application/json")
loHttp.SetRequestHeader("x-hotelid","{{HotelId}}")
// Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"
loHttp.SetRequestHeader("x-app-key","{{AppKey}}")
loSbResponseBody = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://domain.com/par/v0/hotels/{{HotelId}}/rates/{{RatePlanCode}}",loSbResponseBody)
if (llSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loSbResponseBody
return
endif
? "Response status code = " + str(loHttp.LastStatus)
? loSbResponseBody.GetAsString()
release loHttp
release loSbResponseBody
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-H "x-hotelid: {{HotelId}}"
-H "x-app-key: {{AppKey}}"
https://domain.com/par/v0/hotels/{{HotelId}}/rates/{{RatePlanCode}}
Postman Collection Item JSON
{
"name": "Get rate plan Details including the long description",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{Token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "x-hotelid",
"type": "text",
"value": "{{HotelId}}"
},
{
"key": "x-app-key",
"value": "{{AppKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{HostName}}/par/v0/hotels/{{HotelId}}/rates/{{RatePlanCode}}",
"host": [
"{{HostName}}"
],
"path": [
"par",
"v0",
"hotels",
"{{HotelId}}",
"rates",
"{{RatePlanCode}}"
]
},
"description": "Fetch the Rate Plan Information such as long description"
},
"response": [
]
}