(Lianja) 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
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loHttp = createobject("CkHttp")
// To log the exact HTTP request/response to a session log file:
loHttp.SessionLogFilename = "/someDir/sessionLog.txt"
loHttp.SetRequestHeader("X-Auth-Key","xxxxxxxxxxxxxxxxxxxxxxxxx")
loSbJson = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]",loSbJson)
if (llSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loSbJson
return
endif
if (loHttp.LastStatus <> 200) then
? "status code: " + str(loHttp.LastStatus)
? "response: " + loSbJson.GetAsString()
release loHttp
release loSbJson
return
endif
? "raw response: "
? loSbJson.GetAsString()
loJson = createobject("CkJsonObject")
loJson.LoadSb(loSbJson)
loJson.EmitCompact = .T.
? loJson.Emit()
release loHttp
release loSbJson
release loJson
|