(JavaScript) Download Full Intake Form in JSON Format
The full intake form is very similar to intake summary object, except it adds an array of questions.For more information, see https://support.intakeq.com/article/31-intakeq-api#download-intake
var success = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
var http = new CkHttp();
// To log the exact HTTP request/response to a session log file:
http.SessionLogFilename = "/someDir/sessionLog.txt";
http.SetRequestHeader("X-Auth-Key","xxxxxxxxxxxxxxxxxxxxxxxxx");
var sbJson = new CkStringBuilder();
success = http.QuickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]",sbJson);
if (success == false) {
console.log(http.LastErrorText);
return;
}
if (http.LastStatus !== 200) {
console.log("status code: " + http.LastStatus);
console.log("response: " + sbJson.GetAsString());
return;
}
console.log("raw response: ");
console.log(sbJson.GetAsString());
var json = new CkJsonObject();
json.LoadSb(sbJson);
json.EmitCompact = true;
console.log(json.Emit());
|