(Tcl) Bluzone Get List of Beacons
Get beacons for a project. For more information, see https://bluzone.io/portal/static/docs/index.html#_getbeaconsbyprojectid
load ./chilkat.dll
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
set http [new_CkHttp]
# Implements the following CURL command:
# curl -X GET \
# https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/devices/beacons \
# -H 'bzid: YOUR_API_KEY_HERE'
CkHttp_SetRequestHeader $http "bzid" "YOUR_API_KEY_HERE"
set sbResponseBody [new_CkStringBuilder]
set success [CkHttp_QuickGetSb $http "https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/devices/beacons" $sbResponseBody]
if {$success == 0} then {
puts [CkHttp_lastErrorText $http]
delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody
exit
}
puts "Response body:"
puts [CkStringBuilder_getAsString $sbResponseBody]
delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody
|