Zig
Zig
Download Full Intake Form in JSON Format
See more IntakeQ Examples
The full intake form is very similar to intake summary object, except it adds an array of questions.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();
// To log the exact HTTP request/response to a session log file:
http.setSessionLogFilename("/someDir/sessionLog.txt");
http.setRequestHeader("X-Auth-Key", "xxxxxxxxxxxxxxxxxxxxxxxxx");
const sb_json = try chilkat.StringBuilder.init();
defer sb_json.deinit();
http.quickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]", sb_json) catch {
std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
return;
};
if (http.getLastStatus() != 200) {
std.debug.print("status code: {d}\n", .{http.getLastStatus()});
std.debug.print("response: {s}\n", .{try sb_json.getAsString(alloc)});
return;
}
std.debug.print("raw response: \n", .{});
std.debug.print("{s}\n", .{try sb_json.getAsString(alloc)});
const json = try chilkat.JsonObject.init();
defer json.deinit();
json.loadSb(sb_json) catch {};
json.setEmitCompact(true);
std.debug.print("{s}\n", .{try json.emit(alloc)});
}