Chilkat Online Tools

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

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkHttpResponseW resp;

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

    http = CkHttpW_Create();

    CkHttpW_SetRequestHeader(http,L"x-app-key",L"{{AppKey}}");
    CkHttpW_SetRequestHeader(http,L"x-hotelid",L"{{HotelId}}");
    // Adds the "Authorization: Bearer <access_token>" header.
    CkHttpW_putAuthToken(http,L"<access_token>");

    resp = CkHttpW_QuickRequest(http,L"DELETE",L"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 (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        return;
    }

    wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
    wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
    CkHttpResponseW_Dispose(resp);


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