Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateString("parameterName","HotelCode")
loo_QueryParams.UpdateString("parameterValue","{{HotelId}}")
loo_QueryParams.UpdateString("parameterName","EventType")
loo_QueryParams.UpdateString("parameterValue","BRKFT")
loo_QueryParams.UpdateString("parameterName","Event_Start")
loo_QueryParams.UpdateString("parameterValue","2021-06-09 08:00:00.0")
loo_QueryParams.UpdateString("parameterName","Event_End")
loo_QueryParams.UpdateString("parameterValue","2010-06-09 09:00:00.0")
loo_QueryParams.UpdateString("includeInactiveFlag","false")
loo_Http.SetRequestHeader("x-app-key","{{AppKey}}")
loo_Http.SetRequestHeader("x-hotelid","{{HotelId}}")
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Resp = loo_Http.QuickRequestParams("GET","https://domain.com/lov/v1/listOfValues/AvailableSpaces",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_QueryParams
Curl Command
curl -G -d "parameterName=HotelCode"
-d "parameterValue=%7B%7BHotelId%7D%7D"
-d "parameterName=EventType"
-d "parameterValue=BRKFT"
-d "parameterName=Event_Start"
-d "parameterValue=2021-06-09%2008%3A00%3A00.0"
-d "parameterName=Event_End"
-d "parameterValue=2010-06-09%2009%3A00%3A00.0"
-d "includeInactiveFlag=false"
-H "Authorization: Bearer <access_token>"
-H "x-app-key: {{AppKey}}"
-H "x-hotelid: {{HotelId}}"
https://domain.com/lov/v1/listOfValues/AvailableSpaces
Postman Collection Item JSON
{
"name": "Search Function Space Availability",
"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}}/lov/v1/listOfValues/AvailableSpaces?parameterName=HotelCode¶meterValue={{HotelId}}¶meterName=EventType¶meterValue=BRKFT¶meterName=Event_Start¶meterValue=2021-06-09+08:00:00.0¶meterName=Event_End¶meterValue=2010-06-09+09:00:00.0&includeInactiveFlag=false",
"host": [
"{{HostName}}"
],
"path": [
"lov",
"v1",
"listOfValues",
"AvailableSpaces"
],
"query": [
{
"key": "parameterName",
"value": "HotelCode"
},
{
"key": "parameterValue",
"value": "{{HotelId}}"
},
{
"key": "parameterName",
"value": "EventType"
},
{
"key": "parameterValue",
"value": "BRKFT",
"description": "Event Type Code found from getEventTypes"
},
{
"key": "parameterName",
"value": "Event_Start"
},
{
"key": "parameterValue",
"value": "2021-06-09+08:00:00.0"
},
{
"key": "parameterName",
"value": "Event_End"
},
{
"key": "parameterValue",
"value": "2010-06-09+09:00:00.0"
},
{
"key": "includeInactiveFlag",
"value": "false"
}
]
}
},
"response": [
]
}