Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global_Ref.html">Global Unlock Sample for sample code.
http := chilkat.NewHttp()
var success bool
queryParams := chilkat.NewJsonObject()
queryParams.UpdateString("searchByRoomType","false")
http.SetRequestHeader("x-app-key","{{AppKey}}")
http.SetRequestHeader("x-hotelid","{{HotelId}}")
// Adds the "Authorization: Bearer <access_token>" header.
http.SetAuthToken("<access_token>")
resp := http.QuickRequestParams("GET","https://domain.com/rsv/config/v0/hotels/{{HotelId}}/upsellRules",queryParams)
if http.LastMethodSuccess() == false {
fmt.Println(http.LastErrorText())
http.DisposeHttp()
queryParams.DisposeJsonObject()
return
}
fmt.Println(resp.StatusCode())
fmt.Println(resp.BodyStr())
resp.DisposeHttpResponse()
http.DisposeHttp()
queryParams.DisposeJsonObject()
Curl Command
curl -G -d "searchByRoomType=false"
-H "Authorization: Bearer <access_token>"
-H "x-app-key: {{AppKey}}"
-H "x-hotelid: {{HotelId}}"
https://domain.com/rsv/config/v0/hotels/{{HotelId}}/upsellRules
Postman Collection Item JSON
{
"name": "Get existing upsell rules",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{Token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "x-app-key",
"type": "text",
"value": "{{AppKey}}"
},
{
"key": "x-hotelid",
"type": "text",
"value": "{{HotelId}}"
}
],
"url": {
"raw": "{{HostName}}/rsv/config/v0/hotels/{{HotelId}}/upsellRules?searchByRoomType=false",
"host": [
"{{HostName}}"
],
"path": [
"rsv",
"config",
"v0",
"hotels",
"{{HotelId}}",
"upsellRules"
],
"query": [
{
"key": "searchByRoomType",
"value": "false"
}
]
}
},
"response": [
]
}