(AutoIt) 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.
$oHttp = ObjCreate("Chilkat.Http")
; To log the exact HTTP request/response to a session log file:
$oHttp.SessionLogFilename = "/someDir/sessionLog.txt"
$oHttp.SetRequestHeader "X-Auth-Key","xxxxxxxxxxxxxxxxxxxxxxxxx"
$oSbJson = ObjCreate("Chilkat.StringBuilder")
Local $bSuccess = $oHttp.QuickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]",$oSbJson)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
If ($oHttp.LastStatus <> 200) Then
ConsoleWrite("status code: " & $oHttp.LastStatus & @CRLF)
ConsoleWrite("response: " & $oSbJson.GetAsString() & @CRLF)
Exit
EndIf
ConsoleWrite("raw response: " & @CRLF)
ConsoleWrite($oSbJson.GetAsString() & @CRLF)
$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.LoadSb($oSbJson)
$oJson.EmitCompact = True
ConsoleWrite($oJson.Emit() & @CRLF)
|