Sample code for 30+ languages & platforms
Lua

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 Lua Downloads

Lua
local chilkat = require("chilkat")

-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.

local http = chilkat.Http.new()

-- To log the exact HTTP request/response to a session log file:
http.session_log_filename = "/someDir/sessionLog.txt"

http:set_request_header("X-Auth-Key", "xxxxxxxxxxxxxxxxxxxxxxxxx")

local sbJson = chilkat.StringBuilder.new()
local success = http:quick_get_sb("https://intakeq.com/api/v1/intakes/[intake-id]", sbJson)
if not success then
    print(http.last_error_text)
    return
end

if http.last_status ~= 200 then
    print("status code: " .. http.last_status)
    print("response: " .. sbJson:get_as_string())
    return
end

print("raw response: ")
print(sbJson:get_as_string())

local json = chilkat.JsonObject.new()

json:load_sb(sbJson)
json.emit_compact = true

print(json:emit())