Returns the entire JSON record for a specific incident.
curl -X GET https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/incidents \
-H "Accept: application/json" \
-H "OData-MaxVersion: 4.0" \
-H "OData-Version: 4.0" \
-d "$expand=customerid_account($select=accountid,name)" \
-d "$filter=incidentid eq c49e62a8-90df-e311-9565-a45d36fc5fe8" \
-H "Authorization: Bearer DYNAMICS_CRM_ACCESS_TOKEN"
#include <CkRestW.h>
#include <CkStringBuilderW.h>
#include <CkJsonObjectW.h>
void ChilkatSample(void)
{
CkRestW rest;
bool success;
// URL: https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/incidents
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect(L"my-dynamics-domain.api.crm.dynamics.com",port,bTls,bAutoReconnect);
if (success != true) {
wprintf(L"ConnectFailReason: %d\n",rest.get_ConnectFailReason());
wprintf(L"%s\n",rest.lastErrorText());
return;
}
rest.AddQueryParam(L"$expand",L"customerid_account($select=accountid,name)");
rest.AddQueryParam(L"$filter",L"incidentid eq c49e62a8-90df-e311-9565-a45d36fc5fe8");
rest.AddHeader(L"OData-MaxVersion",L"4.0");
rest.AddHeader(L"Accept",L"application/json");
rest.AddHeader(L"OData-Version",L"4.0");
rest.AddHeader(L"Authorization",L"Bearer DYNAMICS_CRM_ACCESS_TOKEN");
CkStringBuilderW sbResponseBody;
success = rest.FullRequestNoBodySb(L"GET",L"/api/data/v9.0/incidents",sbResponseBody);
if (success != true) {
wprintf(L"%s\n",rest.lastErrorText());
return;
}
int respStatusCode = rest.get_ResponseStatusCode();
if (respStatusCode >= 400) {
wprintf(L"Response Status Code = %d\n",respStatusCode);
wprintf(L"Response Header:\n");
wprintf(L"%s\n",rest.responseHeader());
wprintf(L"Response Body:\n");
wprintf(L"%s\n",sbResponseBody.getAsString());
return;
}
CkJsonObjectW jsonResponse;
jsonResponse.LoadSb(sbResponseBody);
int i;
int count_i;
const wchar_t *odataContext = jsonResponse.stringOf(L"\"@odata.context\"");
i = 0;
count_i = jsonResponse.SizeOfArray(L"value");
while (i < count_i) {
jsonResponse.put_I(i);
const wchar_t *odataEtag = jsonResponse.stringOf(L"value[i].\"@odata.etag\"");
const wchar_t *v_resolvebykpiid_value = jsonResponse.stringOf(L"value[i]._resolvebykpiid_value");
bool customercontacted = jsonResponse.BoolOf(L"value[i].customercontacted");
const wchar_t *v_accountid_value = jsonResponse.stringOf(L"value[i]._accountid_value");
int prioritycode = jsonResponse.IntOf(L"value[i].prioritycode");
const wchar_t *v_msdyn_incidenttype_value = jsonResponse.stringOf(L"value[i]._msdyn_incidenttype_value");
int caseorigincode = jsonResponse.IntOf(L"value[i].caseorigincode");
const wchar_t *modifiedon = jsonResponse.stringOf(L"value[i].modifiedon");
const wchar_t *v_parentcaseid_value = jsonResponse.stringOf(L"value[i]._parentcaseid_value");
const wchar_t *v_slainvokedid_value = jsonResponse.stringOf(L"value[i]._slainvokedid_value");
const wchar_t *overriddencreatedon = jsonResponse.stringOf(L"value[i].overriddencreatedon");
bool isescalated = jsonResponse.BoolOf(L"value[i].isescalated");
const wchar_t *int_paraturecasenumber = jsonResponse.stringOf(L"value[i].int_paraturecasenumber");
bool checkemail = jsonResponse.BoolOf(L"value[i].checkemail");
const wchar_t *followupby = jsonResponse.stringOf(L"value[i].followupby");
const wchar_t *ticketnumber = jsonResponse.stringOf(L"value[i].ticketnumber");
int versionnumber = jsonResponse.IntOf(L"value[i].versionnumber");
const wchar_t *v_modifiedby_value = jsonResponse.stringOf(L"value[i]._modifiedby_value");
const wchar_t *billedserviceunits = jsonResponse.stringOf(L"value[i].billedserviceunits");
bool decremententitlementterm = jsonResponse.BoolOf(L"value[i].decremententitlementterm");
const wchar_t *onholdtime = jsonResponse.stringOf(L"value[i].onholdtime");
const wchar_t *resolveby = jsonResponse.stringOf(L"value[i].resolveby");
bool int_upsellreferral = jsonResponse.BoolOf(L"value[i].int_upsellreferral");
const wchar_t *messagetypecode = jsonResponse.stringOf(L"value[i].messagetypecode");
const wchar_t *emailaddress = jsonResponse.stringOf(L"value[i].emailaddress");
bool merged = jsonResponse.BoolOf(L"value[i].merged");
const wchar_t *int_surveryparticipation = jsonResponse.stringOf(L"value[i].int_surveryparticipation");
const wchar_t *contractservicelevelcode = jsonResponse.stringOf(L"value[i].contractservicelevelcode");
const wchar_t *v_createdonbehalfby_value = jsonResponse.stringOf(L"value[i]._createdonbehalfby_value");
const wchar_t *v_contactid_value = jsonResponse.stringOf(L"value[i]._contactid_value");
const wchar_t *v_existingcase_value = jsonResponse.stringOf(L"value[i]._existingcase_value");
const wchar_t *productserialnumber = jsonResponse.stringOf(L"value[i].productserialnumber");
const wchar_t *v_owninguser_value = jsonResponse.stringOf(L"value[i]._owninguser_value");
const wchar_t *int_effortnum = jsonResponse.stringOf(L"value[i].int_effortnum");
const wchar_t *escalatedon = jsonResponse.stringOf(L"value[i].escalatedon");
const wchar_t *v_productid_value = jsonResponse.stringOf(L"value[i]._productid_value");
bool followuptaskcreated = jsonResponse.BoolOf(L"value[i].followuptaskcreated");
const wchar_t *v_ownerid_value = jsonResponse.stringOf(L"value[i]._ownerid_value");
const wchar_t *new_actualsatisfaction = jsonResponse.stringOf(L"value[i].new_actualsatisfaction");
const wchar_t *v_socialprofileid_value = jsonResponse.stringOf(L"value[i]._socialprofileid_value");
const wchar_t *v_createdbyexternalparty_value = jsonResponse.stringOf(L"value[i]._createdbyexternalparty_value");
const wchar_t *v_contractid_value = jsonResponse.stringOf(L"value[i]._contractid_value");
const wchar_t *v_modifiedbyexternalparty_value = jsonResponse.stringOf(L"value[i]._modifiedbyexternalparty_value");
const wchar_t *v_masterid_value = jsonResponse.stringOf(L"value[i]._masterid_value");
int timezoneruleversionnumber = jsonResponse.IntOf(L"value[i].timezoneruleversionnumber");
const wchar_t *entityimageid = jsonResponse.stringOf(L"value[i].entityimageid");
const wchar_t *v_primarycontactid_value = jsonResponse.stringOf(L"value[i]._primarycontactid_value");
int importsequencenumber = jsonResponse.IntOf(L"value[i].importsequencenumber");
const wchar_t *v_owningteam_value = jsonResponse.stringOf(L"value[i]._owningteam_value");
bool routecase = jsonResponse.BoolOf(L"value[i].routecase");
bool blockedprofile = jsonResponse.BoolOf(L"value[i].blockedprofile");
int statecode = jsonResponse.IntOf(L"value[i].statecode");
const wchar_t *int_casecategory = jsonResponse.stringOf(L"value[i].int_casecategory");
const wchar_t *entityimage_timestamp = jsonResponse.stringOf(L"value[i].entityimage_timestamp");
int firstresponseslastatus = jsonResponse.IntOf(L"value[i].firstresponseslastatus");
const wchar_t *traversedpath = jsonResponse.stringOf(L"value[i].traversedpath");
const wchar_t *int_actualsatisfaction = jsonResponse.stringOf(L"value[i].int_actualsatisfaction");
const wchar_t *v_int_associatedproduct_value = jsonResponse.stringOf(L"value[i]._int_associatedproduct_value");
const wchar_t *v_customerid_value = jsonResponse.stringOf(L"value[i]._customerid_value");
const wchar_t *entityimage = jsonResponse.stringOf(L"value[i].entityimage");
const wchar_t *v_entitlementid_value = jsonResponse.stringOf(L"value[i]._entitlementid_value");
bool activitiescomplete = jsonResponse.BoolOf(L"value[i].activitiescomplete");
const wchar_t *new_upsellreferral = jsonResponse.stringOf(L"value[i].new_upsellreferral");
int statuscode = jsonResponse.IntOf(L"value[i].statuscode");
const wchar_t *processid = jsonResponse.stringOf(L"value[i].processid");
const wchar_t *v_contractdetailid_value = jsonResponse.stringOf(L"value[i]._contractdetailid_value");
int int_customereffort = jsonResponse.IntOf(L"value[i].int_customereffort");
const wchar_t *responseby = jsonResponse.stringOf(L"value[i].responseby");
const wchar_t *v_transactioncurrencyid_value = jsonResponse.stringOf(L"value[i]._transactioncurrencyid_value");
const wchar_t *sentimentvalue = jsonResponse.stringOf(L"value[i].sentimentvalue");
const wchar_t *v_slaid_value = jsonResponse.stringOf(L"value[i]._slaid_value");
const wchar_t *influencescore = jsonResponse.stringOf(L"value[i].influencescore");
const wchar_t *v_firstresponsebykpiid_value = jsonResponse.stringOf(L"value[i]._firstresponsebykpiid_value");
const wchar_t *utcconversiontimezonecode = jsonResponse.stringOf(L"value[i].utcconversiontimezonecode");
const wchar_t *numberofchildincidents = jsonResponse.stringOf(L"value[i].numberofchildincidents");
const wchar_t *incidentid = jsonResponse.stringOf(L"value[i].incidentid");
const wchar_t *new_casecategory = jsonResponse.stringOf(L"value[i].new_casecategory");
const wchar_t *v_owningbusinessunit_value = jsonResponse.stringOf(L"value[i]._owningbusinessunit_value");
int casetypecode = jsonResponse.IntOf(L"value[i].casetypecode");
int resolvebyslastatus = jsonResponse.IntOf(L"value[i].resolvebyslastatus");
const wchar_t *createdon = jsonResponse.stringOf(L"value[i].createdon");
int severitycode = jsonResponse.IntOf(L"value[i].severitycode");
const wchar_t *exchangerate = jsonResponse.stringOf(L"value[i].exchangerate");
const wchar_t *v_subjectid_value = jsonResponse.stringOf(L"value[i]._subjectid_value");
int servicestage = jsonResponse.IntOf(L"value[i].servicestage");
const wchar_t *description = jsonResponse.stringOf(L"value[i].description");
const wchar_t *lastonholdtime = jsonResponse.stringOf(L"value[i].lastonholdtime");
const wchar_t *actualserviceunits = jsonResponse.stringOf(L"value[i].actualserviceunits");
const wchar_t *title = jsonResponse.stringOf(L"value[i].title");
const wchar_t *v_createdby_value = jsonResponse.stringOf(L"value[i]._createdby_value");
bool isdecrementing = jsonResponse.BoolOf(L"value[i].isdecrementing");
const wchar_t *v_modifiedonbehalfby_value = jsonResponse.stringOf(L"value[i]._modifiedonbehalfby_value");
int customersatisfactioncode = jsonResponse.IntOf(L"value[i].customersatisfactioncode");
const wchar_t *stageid = jsonResponse.stringOf(L"value[i].stageid");
const wchar_t *v_kbarticleid_value = jsonResponse.stringOf(L"value[i]._kbarticleid_value");
const wchar_t *entityimage_url = jsonResponse.stringOf(L"value[i].entityimage_url");
bool firstresponsesent = jsonResponse.BoolOf(L"value[i].firstresponsesent");
int incidentstagecode = jsonResponse.IntOf(L"value[i].incidentstagecode");
const wchar_t *customerid_accountAccountid = jsonResponse.stringOf(L"value[i].customerid_account.accountid");
const wchar_t *customerid_accountName = jsonResponse.stringOf(L"value[i].customerid_account.name");
i = i + 1;
}
}
{
"@odata.context": "https://mydomain.api.crm.dynamics.com/api/data/v9.0/$metadata#incidents(customerid_account(accountid,name))",
"value": [
{
"@odata.etag": "W/\"1161596\"",
"_resolvebykpiid_value": null,
"customercontacted": false,
"_accountid_value": null,
"prioritycode": 2,
"_msdyn_incidenttype_value": null,
"caseorigincode": 2,
"modifiedon": "2018-03-03T12:34:48Z",
"_parentcaseid_value": null,
"_slainvokedid_value": null,
"overriddencreatedon": "2018-03-03T12:34:48Z",
"isescalated": false,
"int_paraturecasenumber": null,
"checkemail": false,
"followupby": "2015-06-04T16:15:42Z",
"ticketnumber": "CAS-01220-S1K8F4",
"versionnumber": 1161596,
"_modifiedby_value": "32ff7175-0dbe-4acb-872e-22f86435bf98",
"billedserviceunits": null,
"decremententitlementterm": true,
"onholdtime": null,
"resolveby": "2015-06-05T16:15:42Z",
"int_upsellreferral": false,
"messagetypecode": null,
"emailaddress": null,
"merged": false,
"int_surveryparticipation": null,
"contractservicelevelcode": null,
"_createdonbehalfby_value": null,
"_contactid_value": null,
"_existingcase_value": null,
"productserialnumber": null,
"_owninguser_value": "32ff7175-0dbe-4acb-872e-22f86435bf98",
"int_effortnum": null,
"escalatedon": null,
"_productid_value": "3509d8af-7bc3-e411-80df-fc15b42886e8",
"followuptaskcreated": false,
"_ownerid_value": "32ff7175-0dbe-4acb-872e-22f86435bf98",
"new_actualsatisfaction": null,
"_socialprofileid_value": null,
"_createdbyexternalparty_value": null,
"_contractid_value": null,
"_modifiedbyexternalparty_value": null,
"_masterid_value": null,
"timezoneruleversionnumber": 0,
"entityimageid": null,
"_primarycontactid_value": null,
"importsequencenumber": 124,
"_owningteam_value": null,
"routecase": true,
"blockedprofile": false,
"statecode": 0,
"int_casecategory": null,
"entityimage_timestamp": null,
"firstresponseslastatus": 1,
"traversedpath": null,
"int_actualsatisfaction": null,
"_int_associatedproduct_value": null,
"_customerid_value": "b6a19cdd-88df-e311-b8e5-6c3be5a8b200",
"entityimage": null,
"_entitlementid_value": null,
"activitiescomplete": false,
"new_upsellreferral": null,
"statuscode": 1,
"processid": "0ffbcde4-61c1-4355-aa89-aa1d7b2b8792",
"_contractdetailid_value": null,
"int_customereffort": 121590000,
"responseby": null,
"_transactioncurrencyid_value": null,
"sentimentvalue": null,
"_slaid_value": null,
"influencescore": null,
"_firstresponsebykpiid_value": null,
"utcconversiontimezonecode": null,
"numberofchildincidents": null,
"incidentid": "c49e62a8-90df-e311-9565-a45d36fc5fe8",
"new_casecategory": null,
"_owningbusinessunit_value": "c4106190-c81e-e811-a980-000d3a192e9a",
"casetypecode": 2,
"resolvebyslastatus": 1,
"createdon": "2017-01-20T22:50:47Z",
"severitycode": 1,
"exchangerate": null,
"_subjectid_value": "191de3d1-21d5-e411-80eb-c4346bad3638",
"servicestage": 0,
"description": null,
"lastonholdtime": null,
"actualserviceunits": null,
"title": "Faulty product catalog",
"_createdby_value": "32ff7175-0dbe-4acb-872e-22f86435bf98",
"isdecrementing": false,
"_modifiedonbehalfby_value": null,
"customersatisfactioncode": 3,
"stageid": "92a6721b-d465-4d36-aef7-e8822d7a5a6a",
"_kbarticleid_value": null,
"entityimage_url": null,
"firstresponsesent": false,
"incidentstagecode": 1,
"customerid_account": {
"accountid": "b6a19cdd-88df-e311-b8e5-6c3be5a8b200",
"name": "Fourth Coffee"
}
}
]
}