Chilkat Online Tools

lianja / ORACLE Hospitality OPERA Cloud REST API Workflows / Delete a Wake Up Call

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("x-app-key","{{AppKey}}")
loHttp.SetRequestHeader("x-hotelid","{{HotelId}}")
// Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"

loResp = loHttp.QuickRequest("DELETE","https://domain.com/fof/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/wakeUpCalls?newCallTime=2021-10-07+12:00:00&id=898395&callTime=2021-10-07+12:00:00&startDate=2021-10-07")
if (loHttp.LastMethodSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    return
endif

? str(loResp.StatusCode)
? loResp.BodyStr
release loResp


release loHttp

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
	-H "x-hotelid: {{HotelId}}"
	-H "x-app-key: {{AppKey}}"
https://domain.com/fof/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/wakeUpCalls?newCallTime=2021-10-07+12:00:00&id=898395&callTime=2021-10-07+12:00:00&startDate=2021-10-07

Postman Collection Item JSON

{
  "name": "Delete a Wake Up Call",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{Token}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
      {
        "key": "x-hotelid",
        "value": "{{HotelId}}"
      },
      {
        "key": "x-app-key",
        "value": "{{AppKey}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{HostName}}/fof/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/wakeUpCalls?newCallTime=2021-10-07+12:00:00&id=898395&callTime=2021-10-07+12:00:00&startDate=2021-10-07",
      "host": [
        "{{HostName}}"
      ],
      "path": [
        "fof",
        "v0",
        "hotels",
        "{{HotelId}}",
        "reservations",
        "{{ReservationId}}",
        "wakeUpCalls"
      ],
      "query": [
        {
          "key": "newCallTime",
          "value": "2021-10-07+12:00:00"
        },
        {
          "key": "id",
          "value": "898395"
        },
        {
          "key": "callTime",
          "value": "2021-10-07+12:00:00"
        },
        {
          "key": "startDate",
          "value": "2021-10-07"
        }
      ]
    }
  },
  "response": [
  ]
}