Sample code for 30+ languages & platforms
DataFlex

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

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoHttp
    Variant vSbJson
    Handle hoSbJson
    Handle hoJson
    String sTemp1
    Integer iTemp1

    Move False To iSuccess

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // To log the exact HTTP request/response to a session log file:
    Set ComSessionLogFilename Of hoHttp To "/someDir/sessionLog.txt"

    Send ComSetRequestHeader To hoHttp "X-Auth-Key" "xxxxxxxxxxxxxxxxxxxxxxxxx"

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbJson
    If (Not(IsComObjectCreated(hoSbJson))) Begin
        Send CreateComObject of hoSbJson
    End
    Get pvComObject of hoSbJson to vSbJson
    Get ComQuickGetSb Of hoHttp "https://intakeq.com/api/v1/intakes/[intake-id]" vSbJson To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComLastStatus Of hoHttp To iTemp1
    If (iTemp1 <> 200) Begin
        Get ComLastStatus Of hoHttp To iTemp1
        Showln "status code: " iTemp1
        Get ComGetAsString Of hoSbJson To sTemp1
        Showln "response: " sTemp1
        Procedure_Return
    End

    Showln "raw response: "
    Get ComGetAsString Of hoSbJson To sTemp1
    Showln sTemp1

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End

    Get pvComObject of hoSbJson to vSbJson
    Get ComLoadSb Of hoJson vSbJson To iSuccess
    Set ComEmitCompact Of hoJson To True

    Get ComEmit Of hoJson To sTemp1
    Showln sTemp1


End_Procedure