(Delphi DLL) Bluzone Get List of Beacons
Get beacons for a project. For more information, see https://bluzone.io/portal/static/docs/index.html#_getbeaconsbyprojectid
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, StringBuilder, Http;
...
procedure TForm1.Button1Click(Sender: TObject);
var
http: HCkHttp;
success: Boolean;
sbResponseBody: HCkStringBuilder;
begin
// 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) then
begin
Memo1.Lines.Add(CkHttp__lastErrorText(http));
Exit;
end;
Memo1.Lines.Add('Response body:');
Memo1.Lines.Add(CkStringBuilder__getAsString(sbResponseBody));
CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
end;
|