(Unicode C) Bluzone Get List of Beacons
Get beacons for a project. For more information, see https://bluzone.io/portal/static/docs/index.html#_getbeaconsbyprojectid
#include <C_CkHttpW.h>
#include <C_CkStringBuilderW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
HCkStringBuilderW sbResponseBody;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// 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'
CkHttpW_SetRequestHeader(http,L"bzid",L"YOUR_API_KEY_HERE");
sbResponseBody = CkStringBuilderW_Create();
success = CkHttpW_QuickGetSb(http,L"https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/devices/beacons",sbResponseBody);
if (success == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
wprintf(L"Response body:\n");
wprintf(L"%s\n",CkStringBuilderW_getAsString(sbResponseBody));
CkHttpW_Dispose(http);
CkStringBuilderW_Dispose(sbResponseBody);
}
|