Sample code for 30+ languages & platforms
Zig

IntakeQ: Download Intake Form PDF

See more IntakeQ Examples

Use this method to download a client’s complete intake package as a PDF file.

Chilkat Zig Downloads

Zig
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();

    http.setRequestHeader("X-Auth-Key", "xxxxxxxxxxxxxxxxxxxxxxxxx");

    http.download("https://intakeq.com/api/v1/intakes/[intake-id]/pdf", "my_local_dir/intake_form_xxxx.pdf") catch {
        std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
        return;
    };

    std.debug.print("Success.\n", .{});
}