Chilkat Online Tools

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

Back to Collection Items

var
http: TChilkatHttp;
success: Integer;
resp: IChilkatHttpResponse;

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

http := TChilkatHttp.Create(Self);

http.SetRequestHeader('x-app-key','{{AppKey}}');
http.SetRequestHeader('x-hotelid','{{HotelId}}');
// Adds the "Authorization: Bearer <access_token>" header.
http.AuthToken := '<access_token>';

resp := http.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 (http.LastMethodSuccess = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add(IntToStr(resp.StatusCode));
Memo1.Lines.Add(resp.BodyStr);

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