Chilkat Online Tools

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

Back to Collection Items

load ./chilkat.dll

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

set http [new_CkHttp]

CkHttp_SetRequestHeader $http "x-app-key" "{{AppKey}}"
CkHttp_SetRequestHeader $http "x-hotelid" "{{HotelId}}"
# Adds the "Authorization: Bearer <access_token>" header.
CkHttp_put_AuthToken $http "<access_token>"

# resp is a CkHttpResponse
set resp [CkHttp_QuickRequest $http "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 {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    exit
}

puts [CkHttpResponse_get_StatusCode $resp]
puts [CkHttpResponse_bodyStr $resp]
delete_CkHttpResponse $resp


delete_CkHttp $http

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": [
  ]
}