Sample code for 30+ languages & platforms
Zig Requires Chilkat v11.0.0+

Activix CRM Update a Lead

See more Activix CRM Examples

Demonstrates how to update a lead and returns the updated lead.

Chilkat Zig Downloads

Zig
const std = @import("std");
const chilkat = @import("chilkat");

pub fn main(init: std.process.Init) !void {
    const alloc = init.arena.allocator();

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

    const http = try chilkat.Http.init();
    defer http.deinit();

    http.setAuthToken("ACCESS_TOKEN");

    http.setAccept("application/json");

    // The following JSON is sent in the request body:

    // {
    //   "first_name": "John",
    //   "last_name": "Doe",
    //   "advisor": {
    //     "first_name": "Johan",
    //     "last_name": "Strauss"
    //   }
    // }

    // Use this online tool to generate the code from sample JSON:
    // Generate Code to Create JSON

    const json_request_body = try chilkat.JsonObject.init();
    defer json_request_body.deinit();
    json_request_body.updateString("first_name", "John") catch {};
    json_request_body.updateString("last_name", "Doe") catch {};
    json_request_body.updateString("advisor.first_name", "Johan") catch {};
    json_request_body.updateString("advisor.last_name", "Strauss") catch {};

    var url: [:0]const u8 = "https://crm.activix.ca/api/v2/leads/LEAD_ID";

    const resp = try chilkat.HttpResponse.init();
    defer resp.deinit();
    http.httpJson("PUT", url, json_request_body, "application/json", resp) catch {
        std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
        return;
    };

    std.debug.print("Response Status Code: {d}\n", .{resp.getStatusCode()});

    const json_response = try chilkat.JsonObject.init();
    defer json_response.deinit();
    json_response.load(try resp.getBodyStr(alloc)) catch {};
    json_response.setEmitCompact(false);
    std.debug.print("{s}\n", .{try json_response.emit(alloc)});

    if (resp.getStatusCode() >= 300) {
        std.debug.print("Failed.\n", .{});
        return;
    }

    // Sample output...
    // (See the parsing code below..)
    //
    // Use the this online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    // {
    //     "data": {
    //         "id": 3387562,
    //         "created_at": "2018-04-09T18:05:00+00:00",
    //         "updated_at": "2018-04-09T18:07:00+00:00",
    //         "first_name": "John",
    //         "last_name": "Doe",
    //         ...
    //         "account": {
    //             "id": 66,
    //             ...
    //         },
    //         "advisor": {
    //             "id": 51112,
    //             ...
    //         },
    //         "emails": [
    //             {
    //                 "id": 3664451,
    //                 ...
    //             },
    //             ...
    //         ],
    //         "phones": [
    //             {
    //                 "id": 9465546,
    //                 ...
    //             },
    //             ...
    //         ],
    //         "vehicles": [
    //             {
    //                 "id": 4542214,
    //                 ...
    //             },
    //             ...
    //         ]
    //     }
    // }

    var data_account_id: i32 = 0;

    var i: i32 = 0;
    var count_i: i32 = 0;
    var id: i32 = 0;
    var created_at: [:0]const u8 = "";
    var updated_at: [:0]const u8 = "";
    var lead_id: i32 = 0;
    var address: [:0]const u8 = "";
    var v_type: [:0]const u8 = "";
    var valid: bool = false;
    var extension: [:0]const u8 = "";
    var number: [:0]const u8 = "";
    var validated: bool = false;
    var mobile: bool = false;
    var accessories: [:0]const u8 = "";
    var allowed_odometer: [:0]const u8 = "";
    var balance: i32 = 0;
    var budget_max: [:0]const u8 = "";
    var budget_min: [:0]const u8 = "";
    var cash_down: [:0]const u8 = "";
    var category: [:0]const u8 = "";
    var category_rv: [:0]const u8 = "";
    var client_number: [:0]const u8 = "";
    var color_exterior: [:0]const u8 = "";
    var color_interior: [:0]const u8 = "";
    var comment: [:0]const u8 = "";
    var condition: [:0]const u8 = "";
    var end_contract_date: [:0]const u8 = "";
    var end_warranty_date: [:0]const u8 = "";
    var engine: [:0]const u8 = "";
    var extended_warranty: [:0]const u8 = "";
    var fuel: [:0]const u8 = "";
    var length_max: [:0]const u8 = "";
    var length_min: [:0]const u8 = "";
    var license_plate: [:0]const u8 = "";
    var make: [:0]const u8 = "";
    var modality: [:0]const u8 = "";
    var model: [:0]const u8 = "";
    var odometer: [:0]const u8 = "";
    var offer_number: [:0]const u8 = "";
    var v_option: [:0]const u8 = "";
    var order_number: [:0]const u8 = "";
    var payment: [:0]const u8 = "";
    var payment_frequency: [:0]const u8 = "";
    var preparation: [:0]const u8 = "";
    var price: [:0]const u8 = "";
    var profit: [:0]const u8 = "";
    var purchase_date: [:0]const u8 = "";
    var rate: [:0]const u8 = "";
    var recall: [:0]const u8 = "";
    var recorded_date: [:0]const u8 = "";
    var residual: [:0]const u8 = "";
    var security_deposit: [:0]const u8 = "";
    var sleeping: [:0]const u8 = "";
    var sold: bool = false;
    var sold_by: [:0]const u8 = "";
    var sold_date: [:0]const u8 = "";
    var stock: [:0]const u8 = "";
    var stock_state: [:0]const u8 = "";
    var term: [:0]const u8 = "";
    var tire: bool = false;
    var transmission: [:0]const u8 = "";
    var trim: [:0]const u8 = "";

    var value: [:0]const u8 = "";
    var vin: [:0]const u8 = "";
    var warranty: [:0]const u8 = "";
    var weight: [:0]const u8 = "";
    var year: [:0]const u8 = "";
    var year_max: [:0]const u8 = "";
    var year_min: [:0]const u8 = "";

    _ = json_response.intOf("data.id");
    _ = try json_response.stringOf(alloc, "data.created_at");
    _ = try json_response.stringOf(alloc, "data.updated_at");
    data_account_id = json_response.intOf("data.account_id");
    _ = try json_response.stringOf(alloc, "data.address_line1");
    _ = try json_response.stringOf(alloc, "data.address_line2");
    _ = try json_response.stringOf(alloc, "data.appointment_date");
    _ = json_response.boolOf("data.appt_call");
    _ = try json_response.stringOf(alloc, "data.available_date");
    _ = try json_response.stringOf(alloc, "data.average_spending");
    _ = try json_response.stringOf(alloc, "data.be_back_date");
    _ = try json_response.stringOf(alloc, "data.birth_date");
    _ = try json_response.stringOf(alloc, "data.business");
    _ = try json_response.stringOf(alloc, "data.call_date");
    _ = try json_response.stringOf(alloc, "data.city");
    _ = try json_response.stringOf(alloc, "data.civility");
    _ = try json_response.stringOf(alloc, "data.code");
    _ = try json_response.stringOf(alloc, "data.country");
    _ = try json_response.stringOf(alloc, "data.csi_date");
    _ = try json_response.stringOf(alloc, "data.delivered_by_id");
    _ = try json_response.stringOf(alloc, "data.delivered_date");
    _ = try json_response.stringOf(alloc, "data.delivery_date");
    _ = try json_response.stringOf(alloc, "data.division");
    _ = try json_response.stringOf(alloc, "data.end_service_date");
    _ = try json_response.stringOf(alloc, "data.first_name");
    _ = try json_response.stringOf(alloc, "data.gas");
    _ = json_response.intOf("data.gender");
    _ = json_response.boolOf("data.invoiced");
    _ = try json_response.stringOf(alloc, "data.last_name");
    _ = try json_response.stringOf(alloc, "data.last_visit_date");
    _ = try json_response.stringOf(alloc, "data.locale");
    _ = try json_response.stringOf(alloc, "data.loyalty");
    _ = try json_response.stringOf(alloc, "data.next_visit_date");
    _ = try json_response.stringOf(alloc, "data.odometer_last_visit");
    _ = try json_response.stringOf(alloc, "data.open_work_order_date");
    _ = try json_response.stringOf(alloc, "data.planned_pick_up_date");
    _ = try json_response.stringOf(alloc, "data.postal_code");
    _ = try json_response.stringOf(alloc, "data.prepaid");
    _ = json_response.boolOf("data.prepared");
    _ = try json_response.stringOf(alloc, "data.presented_date");
    _ = try json_response.stringOf(alloc, "data.promised_date");
    _ = try json_response.stringOf(alloc, "data.province");
    _ = try json_response.stringOf(alloc, "data.rating");
    _ = json_response.boolOf("data.reached_client");
    _ = try json_response.stringOf(alloc, "data.refinanced_date");
    _ = try json_response.stringOf(alloc, "data.repair_date");
    _ = try json_response.stringOf(alloc, "data.repair_order");
    _ = try json_response.stringOf(alloc, "data.result");
    _ = try json_response.stringOf(alloc, "data.road_test_date");
    _ = try json_response.stringOf(alloc, "data.sale_date");
    _ = try json_response.stringOf(alloc, "data.second_contact");
    _ = try json_response.stringOf(alloc, "data.second_contact_civility");
    _ = try json_response.stringOf(alloc, "data.segment");
    _ = json_response.boolOf("data.service_cleaned");
    _ = try json_response.stringOf(alloc, "data.service_interval_km");
    _ = try json_response.stringOf(alloc, "data.service_monthly_km");
    _ = try json_response.stringOf(alloc, "data.service_process.intention");
    _ = try json_response.stringOf(alloc, "data.service_process.transport");
    _ = try json_response.stringOf(alloc, "data.service_process.walk_around");
    _ = try json_response.stringOf(alloc, "data.sex");
    _ = try json_response.stringOf(alloc, "data.source");
    _ = try json_response.stringOf(alloc, "data.status");
    _ = try json_response.stringOf(alloc, "data.storage");
    _ = try json_response.stringOf(alloc, "data.take_over_date");
    _ = try json_response.stringOf(alloc, "data.type");
    _ = try json_response.stringOf(alloc, "data.unsubscribe_all_date");
    _ = try json_response.stringOf(alloc, "data.unsubscribe_call_date");
    _ = try json_response.stringOf(alloc, "data.unsubscribe_email_date");
    _ = try json_response.stringOf(alloc, "data.unsubscribe_sms_date");
    _ = try json_response.stringOf(alloc, "data.work_order");
    data_account_id = json_response.intOf("data.account.id");
    _ = try json_response.stringOf(alloc, "data.account.created_at");
    _ = try json_response.stringOf(alloc, "data.account.updated_at");
    _ = json_response.intOf("data.account.partner_id");
    _ = json_response.boolOf("data.account.activity_report");
    _ = json_response.boolOf("data.account.commercial");
    _ = json_response.boolOf("data.account.event");
    _ = json_response.boolOf("data.account.leadxpress");
    _ = json_response.boolOf("data.account.loyalty");
    _ = json_response.boolOf("data.account.phone_up");
    _ = json_response.boolOf("data.account.renewal");
    _ = json_response.boolOf("data.account.sale_table");
    _ = json_response.boolOf("data.account.service");
    _ = json_response.boolOf("data.account.walk_in");
    _ = json_response.boolOf("data.account.webboost");
    _ = json_response.boolOf("data.account.account_manager");
    _ = try json_response.stringOf(alloc, "data.account.activation_date");
    _ = json_response.boolOf("data.account.active");
    _ = json_response.boolOf("data.account.assigned_lead");
    _ = json_response.boolOf("data.account.auto_renewal");
    _ = json_response.boolOf("data.account.auto_renewal_new");
    _ = json_response.boolOf("data.account.auto_renewal_used");
    _ = json_response.boolOf("data.account.automation");
    _ = json_response.boolOf("data.account.bdc_advisor");
    _ = json_response.boolOf("data.account.calendar_options");
    _ = json_response.boolOf("data.account.client_card_fields.process.gas");
    _ = json_response.boolOf("data.account.client_card_fields.process.recorded");
    _ = json_response.boolOf("data.account.client_card_fields.process.available");
    _ = json_response.boolOf("data.account.client_card_fields.process.discounted");
    _ = json_response.boolOf("data.account.client_card_fields.commercial.profit");
    _ = json_response.boolOf("data.account.client_card_fields.commercial.exclude");
    _ = json_response.boolOf("data.account.client_card_fields.commercial.meeting");
    _ = json_response.boolOf("data.account.client_card_fields.performance.deposit");
    _ = json_response.boolOf("data.account.client_card_fields.performance.refinanced");
    _ = json_response.boolOf("data.account.client_card_fields.performance.dealer_tour");
    _ = json_response.boolOf("data.account.client_card_fields.performance.walk_around");
    _ = json_response.boolOf("data.account.client_card_fields.performance.qualification");
    _ = json_response.boolOf("data.account.client_card_fields.performance.twenty_four_hour");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.budget");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.sector");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_1");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_2");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_3");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_4");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_5");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_6");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_7");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_8");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_9");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.custom_10");
    _ = json_response.boolOf("data.account.client_card_fields.general_info.communication_preference");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.vin");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.fuel");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.rate");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.term");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.tire");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.year");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.color");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.price");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.stock");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.total");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.budget");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.engine");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.length");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.profit");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.suffix");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.weight");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.comment");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.mileage");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.payment");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.bodyType");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.category");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.modality");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.residual");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.sleeping");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.warranty");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.frequency");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.accessories");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.category_rv");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.preparation");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.initial_cash");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.offer_number");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.order_number");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.transmission");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.documentation");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.drivingWheels");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.color_exterior");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.color_interior");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.allowed_mileage");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.security_deposit");
    _ = json_response.boolOf("data.account.client_card_fields.wanted_vehicle.end_contract_date");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.vin");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.fuel");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.link");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.rate");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.term");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.year");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.color");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.price");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.stock");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.value");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.budget");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.engine");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.length");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.profit");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.suffix");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.weight");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.balance");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.comment");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.mileage");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.payment");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.renewal");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.sold_by");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.bodyType");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.category");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.modality");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.residual");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.sleeping");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.warranty");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.condition");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.frequency");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.intention");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.refinance");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.requested");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.sold_date");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.category_rv");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.institution");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.initial_cash");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.offer_number");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.transmission");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.drivingWheels");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.color_exterior");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.color_interior");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.allowed_mileage");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.security_deposit");
    _ = json_response.boolOf("data.account.client_card_fields.exchange_vehicle.end_contract_date");
    _ = json_response.boolOf("data.account.client_number");
    _ = json_response.boolOf("data.account.confirmation_appt");
    _ = json_response.boolOf("data.account.credit");
    _ = json_response.boolOf("data.account.csi");
    _ = json_response.boolOf("data.account.csi_used");
    _ = try json_response.stringOf(alloc, "data.account.default_deliveryman_user_id");
    _ = json_response.boolOf("data.account.delivered_by");
    _ = json_response.boolOf("data.account.disable_communication_audio");
    _ = json_response.boolOf("data.account.duplicates");
    _ = json_response.boolOf("data.account.guest_action");
    _ = json_response.boolOf("data.account.email_client");
    _ = json_response.boolOf("data.account.in_turn");
    _ = json_response.boolOf("data.account.in_turn_director_management");
    _ = json_response.boolOf("data.account.leads_other_division");
    _ = json_response.intOf("data.account.leadxpress_option.priority");
    _ = json_response.intOf("data.account.leadxpress_option.reminder.frequency");
    _ = json_response.intOf("data.account.leadxpress_option.reminder.recurrence");
    _ = json_response.boolOf("data.account.leadxpress_option.schedule.account");
    _ = json_response.boolOf("data.account.leadxpress_option.schedule.advisor");
    _ = json_response.boolOf("data.account.limited_audio_access");
    _ = try json_response.stringOf(alloc, "data.account.logo");
    _ = try json_response.stringOf(alloc, "data.account.logo_en");
    _ = json_response.boolOf("data.account.mandatory_coordinate");
    _ = json_response.boolOf("data.account.manually_status");
    _ = try json_response.stringOf(alloc, "data.account.merge_rule");
    _ = json_response.intOf("data.account.month_start_day");
    _ = try json_response.stringOf(alloc, "data.account.name");
    _ = json_response.boolOf("data.account.niotext");
    _ = json_response.boolOf("data.account.niotext_phone");
    _ = try json_response.stringOf(alloc, "data.account.phone");
    _ = json_response.boolOf("data.account.power_sport");
    _ = json_response.boolOf("data.account.process");
    _ = json_response.boolOf("data.account.recreative_special");
    _ = json_response.boolOf("data.account.result_date_validation");
    _ = json_response.boolOf("data.account.sale_accessories");
    _ = json_response.boolOf("data.account.sale_by_phone");
    _ = json_response.boolOf("data.account.sale_date_month");
    _ = json_response.boolOf("data.account.sale_table_options.accessory_column");
    _ = json_response.boolOf("data.account.sale_table_options.commercial_column");
    _ = json_response.boolOf("data.account.sale_table_options.division_grouped_total_column");
    _ = json_response.boolOf("data.account.sale_validation");
    _ = json_response.boolOf("data.account.scan");
    _ = json_response.boolOf("data.account.stock_required_for_sale");
    _ = json_response.boolOf("data.account.take_over_director");
    _ = json_response.boolOf("data.account.trade_report");
    _ = json_response.boolOf("data.account.unrestricted_assignment");
    _ = json_response.boolOf("data.account.unsubscribe");
    _ = json_response.boolOf("data.account.untreated_lead");
    _ = json_response.boolOf("data.account.vehicle_model_text");
    _ = json_response.boolOf("data.account.vehicle_text");
    _ = json_response.boolOf("data.account.verified_sale");
    _ = json_response.boolOf("data.account.vin_decoder");
    _ = try json_response.stringOf(alloc, "data.account.waiting_sale_date");
    _ = json_response.boolOf("data.account.waiting_sale_option");
    _ = try json_response.stringOf(alloc, "data.advisor");
    _ = try json_response.stringOf(alloc, "data.bdc");
    _ = try json_response.stringOf(alloc, "data.commercial");
    _ = try json_response.stringOf(alloc, "data.service_advisor");
    _ = try json_response.stringOf(alloc, "data.service_agent");
    i = 0;
    count_i = json_response.sizeOfArray("data.emails");
    while (i < count_i) {
        json_response.setI(i);
        id = json_response.intOf("data.emails[i].id");
        created_at = try json_response.stringOf(alloc, "data.emails[i].created_at");
        updated_at = try json_response.stringOf(alloc, "data.emails[i].updated_at");
        lead_id = json_response.intOf("data.emails[i].lead_id");
        address = try json_response.stringOf(alloc, "data.emails[i].address");
        v_type = try json_response.stringOf(alloc, "data.emails[i].type");
        valid = json_response.boolOf("data.emails[i].valid");
        i = i + 1;
    }

    i = 0;
    count_i = json_response.sizeOfArray("data.phones");
    while (i < count_i) {
        json_response.setI(i);
        id = json_response.intOf("data.phones[i].id");
        created_at = try json_response.stringOf(alloc, "data.phones[i].created_at");
        updated_at = try json_response.stringOf(alloc, "data.phones[i].updated_at");
        lead_id = json_response.intOf("data.phones[i].lead_id");
        extension = try json_response.stringOf(alloc, "data.phones[i].extension");
        number = try json_response.stringOf(alloc, "data.phones[i].number");
        v_type = try json_response.stringOf(alloc, "data.phones[i].type");
        valid = json_response.boolOf("data.phones[i].valid");
        validated = json_response.boolOf("data.phones[i].validated");
        mobile = json_response.boolOf("data.phones[i].mobile");
        i = i + 1;
    }

    i = 0;
    count_i = json_response.sizeOfArray("data.vehicles");
    while (i < count_i) {
        json_response.setI(i);
        id = json_response.intOf("data.vehicles[i].id");
        created_at = try json_response.stringOf(alloc, "data.vehicles[i].created_at");
        updated_at = try json_response.stringOf(alloc, "data.vehicles[i].updated_at");
        lead_id = json_response.intOf("data.vehicles[i].lead_id");
        accessories = try json_response.stringOf(alloc, "data.vehicles[i].accessories");
        allowed_odometer = try json_response.stringOf(alloc, "data.vehicles[i].allowed_odometer");
        balance = json_response.intOf("data.vehicles[i].balance");
        budget_max = try json_response.stringOf(alloc, "data.vehicles[i].budget_max");
        budget_min = try json_response.stringOf(alloc, "data.vehicles[i].budget_min");
        cash_down = try json_response.stringOf(alloc, "data.vehicles[i].cash_down");
        category = try json_response.stringOf(alloc, "data.vehicles[i].category");
        category_rv = try json_response.stringOf(alloc, "data.vehicles[i].category_rv");
        client_number = try json_response.stringOf(alloc, "data.vehicles[i].client_number");
        color_exterior = try json_response.stringOf(alloc, "data.vehicles[i].color_exterior");
        color_interior = try json_response.stringOf(alloc, "data.vehicles[i].color_interior");
        comment = try json_response.stringOf(alloc, "data.vehicles[i].comment");
        condition = try json_response.stringOf(alloc, "data.vehicles[i].condition");
        end_contract_date = try json_response.stringOf(alloc, "data.vehicles[i].end_contract_date");
        end_warranty_date = try json_response.stringOf(alloc, "data.vehicles[i].end_warranty_date");
        engine = try json_response.stringOf(alloc, "data.vehicles[i].engine");
        extended_warranty = try json_response.stringOf(alloc, "data.vehicles[i].extended_warranty");
        fuel = try json_response.stringOf(alloc, "data.vehicles[i].fuel");
        length_max = try json_response.stringOf(alloc, "data.vehicles[i].length_max");
        length_min = try json_response.stringOf(alloc, "data.vehicles[i].length_min");
        license_plate = try json_response.stringOf(alloc, "data.vehicles[i].license_plate");
        make = try json_response.stringOf(alloc, "data.vehicles[i].make");
        modality = try json_response.stringOf(alloc, "data.vehicles[i].modality");
        model = try json_response.stringOf(alloc, "data.vehicles[i].model");
        odometer = try json_response.stringOf(alloc, "data.vehicles[i].odometer");
        offer_number = try json_response.stringOf(alloc, "data.vehicles[i].offer_number");
        v_option = try json_response.stringOf(alloc, "data.vehicles[i].option");
        order_number = try json_response.stringOf(alloc, "data.vehicles[i].order_number");
        payment = try json_response.stringOf(alloc, "data.vehicles[i].payment");
        payment_frequency = try json_response.stringOf(alloc, "data.vehicles[i].payment_frequency");
        preparation = try json_response.stringOf(alloc, "data.vehicles[i].preparation");
        price = try json_response.stringOf(alloc, "data.vehicles[i].price");
        profit = try json_response.stringOf(alloc, "data.vehicles[i].profit");
        purchase_date = try json_response.stringOf(alloc, "data.vehicles[i].purchase_date");
        rate = try json_response.stringOf(alloc, "data.vehicles[i].rate");
        recall = try json_response.stringOf(alloc, "data.vehicles[i].recall");
        recorded_date = try json_response.stringOf(alloc, "data.vehicles[i].recorded_date");
        residual = try json_response.stringOf(alloc, "data.vehicles[i].residual");
        security_deposit = try json_response.stringOf(alloc, "data.vehicles[i].security_deposit");
        sleeping = try json_response.stringOf(alloc, "data.vehicles[i].sleeping");
        sold = json_response.boolOf("data.vehicles[i].sold");
        sold_by = try json_response.stringOf(alloc, "data.vehicles[i].sold_by");
        sold_date = try json_response.stringOf(alloc, "data.vehicles[i].sold_date");
        stock = try json_response.stringOf(alloc, "data.vehicles[i].stock");
        stock_state = try json_response.stringOf(alloc, "data.vehicles[i].stock_state");
        term = try json_response.stringOf(alloc, "data.vehicles[i].term");
        tire = json_response.boolOf("data.vehicles[i].tire");
        transmission = try json_response.stringOf(alloc, "data.vehicles[i].transmission");
        trim = try json_response.stringOf(alloc, "data.vehicles[i].trim");
        v_type = try json_response.stringOf(alloc, "data.vehicles[i].type");
        url = try json_response.stringOf(alloc, "data.vehicles[i].url");
        value = try json_response.stringOf(alloc, "data.vehicles[i].value");
        vin = try json_response.stringOf(alloc, "data.vehicles[i].vin");
        warranty = try json_response.stringOf(alloc, "data.vehicles[i].warranty");
        weight = try json_response.stringOf(alloc, "data.vehicles[i].weight");
        year = try json_response.stringOf(alloc, "data.vehicles[i].year");
        year_max = try json_response.stringOf(alloc, "data.vehicles[i].year_max");
        year_min = try json_response.stringOf(alloc, "data.vehicles[i].year_min");
        i = i + 1;
    }

    i = 0;
    count_i = json_response.sizeOfArray("data.related_ids");
    while (i < count_i) {
        json_response.setI(i);
        i = i + 1;
    }
}