Zig
Zig
Bluzone Get List of Beacons
See more Bluzone Examples
Get beacons for a project.Chilkat Zig Downloads
const std = @import("std");
const chilkat = @import("chilkat");
pub fn main(init: std.process.Init) !void {
const alloc = init.arena.allocator();
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = try chilkat.Http.init();
defer http.deinit();
// 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'
http.setRequestHeader("bzid", "YOUR_API_KEY_HERE");
const sb_response_body = try chilkat.StringBuilder.init();
defer sb_response_body.deinit();
http.quickGetSb("https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/devices/beacons", sb_response_body) catch {
std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
return;
};
std.debug.print("Response body:\n", .{});
std.debug.print("{s}\n", .{try sb_response_body.getAsString(alloc)});
}