Chilkat Online Tools

C# / ORACLE Hospitality OPERA Cloud REST API Workflows / Remove an upsell from a reservation

Back to Collection Items

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

Chilkat.Http http = new Chilkat.Http();
bool success;

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

Chilkat.HttpResponse resp = http.QuickRequest("DELETE","https://domain.com/rsv/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/upsell");
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

Debug.WriteLine(Convert.ToString(resp.StatusCode));
Debug.WriteLine(resp.BodyStr);

Curl Command

curl -X DELETE
	-H "Authorization: Bearer <access_token>"
	-H "x-hotelid: {{HotelId}}"
	-H "x-app-key: {{AppKey}}"
https://domain.com/rsv/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/upsell

Postman Collection Item JSON

{
  "name": "Remove an upsell from a reservation",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{Token}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
      {
        "key": "x-hotelid",
        "value": "{{HotelId}}",
        "type": "text"
      },
      {
        "key": "x-app-key",
        "value": "{{AppKey}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{HostName}}/rsv/v0/hotels/{{HotelId}}/reservations/{{ReservationId}}/upsell",
      "host": [
        "{{HostName}}"
      ],
      "path": [
        "rsv",
        "v0",
        "hotels",
        "{{HotelId}}",
        "reservations",
        "{{ReservationId}}",
        "upsell"
      ]
    }
  },
  "response": [
  ]
}