Back to Collection Items
#include <CkHttp.h>
#include <CkHttpResponse.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http;
bool success;
http.SetRequestHeader("x-app-key","{{AppKey}}");
http.SetRequestHeader("x-hotelid","{{HotelId}}");
// Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>");
CkHttpResponse *resp = http.QuickRequest("DELETE","https://domain.com/hsk/v0/hotels/{{HotelId}}/maintenances/{{MainteananceId}}");
if (http.get_LastMethodSuccess() == false) {
std::cout << http.lastErrorText() << "\r\n";
return;
}
std::cout << resp->get_StatusCode() << "\r\n";
std::cout << resp->bodyStr() << "\r\n";
delete resp;
}
Curl Command
curl -X DELETE
-H "Authorization: Bearer <access_token>"
-H "x-hotelid: {{HotelId}}"
-H "x-app-key: {{AppKey}}"
https://domain.com/hsk/v0/hotels/{{HotelId}}/maintenances/{{MainteananceId}}
Postman Collection Item JSON
{
"name": "Delete a Room Maintenance Request",
"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}}"
}
],
"url": {
"raw": "{{HostName}}/hsk/v0/hotels/{{HotelId}}/maintenances/{{MainteananceId}}",
"host": [
"{{HostName}}"
],
"path": [
"hsk",
"v0",
"hotels",
"{{HotelId}}",
"maintenances",
"{{MainteananceId}}"
]
}
},
"response": [
]
}