Chilkat Online Tools

Foxpro / ORACLE Hospitality OPERA Cloud REST API Workflows / get Reservation Queue Statistics

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loQueryParams
LOCAL loResp

* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

loHttp = CreateObject('Chilkat_9_5_0.Http')

loQueryParams = CreateObject('Chilkat_9_5_0.JsonObject')
loQueryParams.UpdateString("metric","AverageCheckInTime")

loHttp.SetRequestHeader("Content-Type","application/json")
loHttp.SetRequestHeader("x-app-key","{{AppKey}}")
loHttp.SetRequestHeader("x-hotelid","{{HotelId}}")
* Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"

loResp = loHttp.QuickRequestParams("GET","https://domain.com/fof/v0/hotels/{{HotelId}}/queueReservationsStatistics",loQueryParams)
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loQueryParams
    CANCEL
ENDIF

? STR(loResp.StatusCode)
? loResp.BodyStr
RELEASE loResp

RELEASE loHttp
RELEASE loQueryParams

Curl Command

curl -G -d "metric=AverageCheckInTime"
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-H "x-app-key: {{AppKey}}"
	-H "x-hotelid: {{HotelId}}"
https://domain.com/fof/v0/hotels/{{HotelId}}/queueReservationsStatistics

Postman Collection Item JSON

{
  "name": "get Reservation Queue Statistics ",
  "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-app-key",
        "type": "text",
        "value": "{{AppKey}}"
      },
      {
        "key": "x-hotelid",
        "type": "text",
        "value": "{{HotelId}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{HostName}}/fof/v0/hotels/{{HotelId}}/queueReservationsStatistics?metric=AverageCheckInTime",
      "host": [
        "{{HostName}}"
      ],
      "path": [
        "fof",
        "v0",
        "hotels",
        "{{HotelId}}",
        "queueReservationsStatistics"
      ],
      "query": [
        {
          "key": "metric",
          "value": "AverageCheckInTime"
        }
      ]
    }
  },
  "response": [
  ]
}