(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_CkHttp.h>
#include <C_CkStringBuilder.h>
void ChilkatSample(void)
{
HCkHttp http;
BOOL success;
HCkStringBuilder sbResponseBody;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_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'
CkHttp_SetRequestHeader(http,"bzid","YOUR_API_KEY_HERE");
sbResponseBody = CkStringBuilder_Create();
success = CkHttp_QuickGetSb(http,"https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/devices/beacons",sbResponseBody);
if (success == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
printf("Response body:\n");
printf("%s\n",CkStringBuilder_getAsString(sbResponseBody));
CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
}
|