Xbase++
Xbase++
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 Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL oSbJson
LOCAL oJson
nSuccess := 0
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oHttp := CreateObject("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 := CreateObject("Chilkat.StringBuilder")
nSuccess := oHttp:QuickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]", oSbJson)
IF (nSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oSbJson:destroy()
RETURN
ENDIF
IF (oHttp:LastStatus != 200)
? "status code: " + Str(oHttp:LastStatus)
? "response: " + oSbJson:GetAsString()
oHttp:destroy()
oSbJson:destroy()
RETURN
ENDIF
? "raw response: "
? oSbJson:GetAsString()
oJson := CreateObject("Chilkat.JsonObject")
oJson:LoadSb(oSbJson)
oJson:EmitCompact := 1
? oJson:Emit()
oHttp:destroy()
oSbJson:destroy()
oJson:destroy()