Rust
Rust
IntakeQ: Query Intake Forms
See more IntakeQ Examples
Use this method to query client intake form summaries. The result set does not contain all the contents of the intake forms, but only their basic information (id, status, client info).Chilkat Rust Downloads
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = chilkat::Http::new();
// Implements the following CURL command:
// curl -X GET \
// https://intakeq.com/api/v1/intakes/summary?client=[searchString]&startDate=[yyyy-MM-dd]&endDate=[yyyy-MM-dd]&page=[pageNumber]&all=[bool] \
// -H 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxx'
// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code
http.set_request_header("X-Auth-Key", "xxxxxxxxxxxxxxxxxxxxxxxxx");
let sb_response_body = chilkat::StringBuilder::new();
if http.quick_get_sb("https://intakeq.com/api/v1/intakes/summary?client=[searchString]&startDate=[yyyy-MM-dd]&endDate=[yyyy-MM-dd]&page=[pageNumber]&all=[bool]", &sb_response_body).is_err() {
println!("{}", http.last_error_text());
return;
}
let jarr_resp = chilkat::JsonArray::new();
let _ = jarr_resp.load_sb(&sb_response_body);
jarr_resp.set_emit_compact(false);
println!("Response Body:");
println!("{}", jarr_resp.emit().unwrap_or_default());
let resp_status_code = http.last_status();
println!("Response Status Code = {}", resp_status_code);
if resp_status_code >= 400 {
println!("Response Header:");
println!("{}", http.last_header());
println!("Failed.");
return;
}
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// [
// {
// "Id": "00000000-0000-0000-0000-000000000000",
// "ClientName": "test",
// "ClientEmail": "test@email.com",
// "ClientId": 9999,
// "Status": "Completed",
// "DateCreated": 1458526480368,
// "DateSubmitted": 1458526532654,
// "QuestionnaireName": "test",
// "QuestionnaireId": "1234acbd",
// "Practitioner": "test@email.com",
// "PractitionerName": "FirstName LastName"
// },
// {
// "Id": "00000000-0000-0000-0000-000000000000",
// "ClientName": "test",
// "ClientEmail": "test@email.com",
// "ClientId": 9999,
// "Status": "Completed",
// "DateCreated": 1458526480368,
// "DateSubmitted": 1458526532654,
// "QuestionnaireName": "test",
// "QuestionnaireId": "1234acbd",
// "Practitioner": "test@email.com",
// "PractitionerName": "FirstName LastName"
// }
// ]
// Sample code for parsing the JSON response...
// Use the following online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON
let mut i = 0;
let count_i = jarr_resp.size();
while i < count_i {
let json = jarr_resp.object_at(i).unwrap();
let _ = json.string_of("Id").unwrap_or_default();
let _ = json.string_of("ClientName").unwrap_or_default();
let _ = json.string_of("ClientEmail").unwrap_or_default();
let _ = json.int_of("ClientId");
let _ = json.string_of("Status").unwrap_or_default();
let _ = json.int_of("DateCreated");
let _ = json.int_of("DateSubmitted");
let _ = json.string_of("QuestionnaireName").unwrap_or_default();
let _ = json.string_of("QuestionnaireId").unwrap_or_default();
let _ = json.string_of("Practitioner").unwrap_or_default();
let _ = json.string_of("PractitionerName").unwrap_or_default();
i = i + 1;
}