Java
Chilkat2 Java
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 Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Http;
import com.chilkatsoft.chilkat2.JsonObject;
import com.chilkatsoft.chilkat2.StringBuilder;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Http http = new Http();
// To log the exact HTTP request/response to a session log file:
http.setSessionLogFilename("/someDir/sessionLog.txt");
http.setRequestHeader("X-Auth-Key", "xxxxxxxxxxxxxxxxxxxxxxxxx");
StringBuilder sbJson = new StringBuilder();
try {
http.quickGetSb("https://intakeq.com/api/v1/intakes/[intake-id]", sbJson);
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
if (http.getLastStatus() != 200) {
System.out.println("status code: " + http.getLastStatus());
System.out.println("response: " + sbJson.getAsString());
return;
}
System.out.println("raw response: ");
System.out.println(sbJson.getAsString());
JsonObject json = new JsonObject();
json.loadSb(sbJson);
json.setEmitCompact(true);
System.out.println(json.emit());
}
}