Sample code for 30+ languages & platforms
C

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

C
#include <C_CkHttp.h>
#include <C_CkStringBuilder.h>
#include <C_CkJsonObject.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHttp http;
    HCkStringBuilder sbJson;
    HCkJsonObject json;

    success = FALSE;

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

    http = CkHttp_Create();

    // To log the exact HTTP request/response to a session log file:
    CkHttp_putSessionLogFilename(http,"/someDir/sessionLog.txt");

    CkHttp_SetRequestHeader(http,"X-Auth-Key","xxxxxxxxxxxxxxxxxxxxxxxxx");

    sbJson = CkStringBuilder_Create();
    success = CkHttp_QuickGetSb(http,"https://intakeq.com/api/v1/intakes/[intake-id]",sbJson);
    if (success == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        CkStringBuilder_Dispose(sbJson);
        return;
    }

    if (CkHttp_getLastStatus(http) != 200) {
        printf("status code: %d\n",CkHttp_getLastStatus(http));
        printf("response: %s\n",CkStringBuilder_getAsString(sbJson));
        CkHttp_Dispose(http);
        CkStringBuilder_Dispose(sbJson);
        return;
    }

    printf("raw response: \n");
    printf("%s\n",CkStringBuilder_getAsString(sbJson));

    json = CkJsonObject_Create();

    CkJsonObject_LoadSb(json,sbJson);
    CkJsonObject_putEmitCompact(json,TRUE);

    printf("%s\n",CkJsonObject_emit(json));


    CkHttp_Dispose(http);
    CkStringBuilder_Dispose(sbJson);
    CkJsonObject_Dispose(json);

    }