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"
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CkRest rest = new CkRest();
boolean success;
// URL: https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/incidents
boolean bTls = true;
int port = 443;
boolean bAutoReconnect = true;
success = rest.Connect("my-dynamics-domain.api.crm.dynamics.com",port,bTls,bAutoReconnect);
if (success != true) {
Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
Log.i(TAG, rest.lastErrorText());
return;
}
rest.AddQueryParam("$expand","customerid_account($select=accountid,name)");
rest.AddQueryParam("$filter","incidentid eq c49e62a8-90df-e311-9565-a45d36fc5fe8");
rest.AddHeader("OData-MaxVersion","4.0");
rest.AddHeader("Accept","application/json");
rest.AddHeader("OData-Version","4.0");
rest.AddHeader("Authorization","Bearer DYNAMICS_CRM_ACCESS_TOKEN");
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = rest.FullRequestNoBodySb("GET","/api/data/v9.0/incidents",sbResponseBody);
if (success != true) {
Log.i(TAG, rest.lastErrorText());
return;
}
int respStatusCode = rest.get_ResponseStatusCode();
if (respStatusCode >= 400) {
Log.i(TAG, "Response Status Code = " + String.valueOf(respStatusCode));
Log.i(TAG, "Response Header:");
Log.i(TAG, rest.responseHeader());
Log.i(TAG, "Response Body:");
Log.i(TAG, sbResponseBody.getAsString());
return;
}
CkJsonObject jsonResponse = new CkJsonObject();
jsonResponse.LoadSb(sbResponseBody);
int i;
int count_i;
String odataContext = jsonResponse.stringOf("\"@odata.context\"");
i = 0;
count_i = jsonResponse.SizeOfArray("value");
while (i < count_i) {
jsonResponse.put_I(i);
String odataEtag = jsonResponse.stringOf("value[i].\"@odata.etag\"");
String v_resolvebykpiid_value = jsonResponse.stringOf("value[i]._resolvebykpiid_value");
boolean customercontacted = jsonResponse.BoolOf("value[i].customercontacted");
String v_accountid_value = jsonResponse.stringOf("value[i]._accountid_value");
int prioritycode = jsonResponse.IntOf("value[i].prioritycode");
String v_msdyn_incidenttype_value = jsonResponse.stringOf("value[i]._msdyn_incidenttype_value");
int caseorigincode = jsonResponse.IntOf("value[i].caseorigincode");
String modifiedon = jsonResponse.stringOf("value[i].modifiedon");
String v_parentcaseid_value = jsonResponse.stringOf("value[i]._parentcaseid_value");
String v_slainvokedid_value = jsonResponse.stringOf("value[i]._slainvokedid_value");
String overriddencreatedon = jsonResponse.stringOf("value[i].overriddencreatedon");
boolean isescalated = jsonResponse.BoolOf("value[i].isescalated");
String int_paraturecasenumber = jsonResponse.stringOf("value[i].int_paraturecasenumber");
boolean checkemail = jsonResponse.BoolOf("value[i].checkemail");
String followupby = jsonResponse.stringOf("value[i].followupby");
String ticketnumber = jsonResponse.stringOf("value[i].ticketnumber");
int versionnumber = jsonResponse.IntOf("value[i].versionnumber");
String v_modifiedby_value = jsonResponse.stringOf("value[i]._modifiedby_value");
String billedserviceunits = jsonResponse.stringOf("value[i].billedserviceunits");
boolean decremententitlementterm = jsonResponse.BoolOf("value[i].decremententitlementterm");
String onholdtime = jsonResponse.stringOf("value[i].onholdtime");
String resolveby = jsonResponse.stringOf("value[i].resolveby");
boolean int_upsellreferral = jsonResponse.BoolOf("value[i].int_upsellreferral");
String messagetypecode = jsonResponse.stringOf("value[i].messagetypecode");
String emailaddress = jsonResponse.stringOf("value[i].emailaddress");
boolean merged = jsonResponse.BoolOf("value[i].merged");
String int_surveryparticipation = jsonResponse.stringOf("value[i].int_surveryparticipation");
String contractservicelevelcode = jsonResponse.stringOf("value[i].contractservicelevelcode");
String v_createdonbehalfby_value = jsonResponse.stringOf("value[i]._createdonbehalfby_value");
String v_contactid_value = jsonResponse.stringOf("value[i]._contactid_value");
String v_existingcase_value = jsonResponse.stringOf("value[i]._existingcase_value");
String productserialnumber = jsonResponse.stringOf("value[i].productserialnumber");
String v_owninguser_value = jsonResponse.stringOf("value[i]._owninguser_value");
String int_effortnum = jsonResponse.stringOf("value[i].int_effortnum");
String escalatedon = jsonResponse.stringOf("value[i].escalatedon");
String v_productid_value = jsonResponse.stringOf("value[i]._productid_value");
boolean followuptaskcreated = jsonResponse.BoolOf("value[i].followuptaskcreated");
String v_ownerid_value = jsonResponse.stringOf("value[i]._ownerid_value");
String new_actualsatisfaction = jsonResponse.stringOf("value[i].new_actualsatisfaction");
String v_socialprofileid_value = jsonResponse.stringOf("value[i]._socialprofileid_value");
String v_createdbyexternalparty_value = jsonResponse.stringOf("value[i]._createdbyexternalparty_value");
String v_contractid_value = jsonResponse.stringOf("value[i]._contractid_value");
String v_modifiedbyexternalparty_value = jsonResponse.stringOf("value[i]._modifiedbyexternalparty_value");
String v_masterid_value = jsonResponse.stringOf("value[i]._masterid_value");
int timezoneruleversionnumber = jsonResponse.IntOf("value[i].timezoneruleversionnumber");
String entityimageid = jsonResponse.stringOf("value[i].entityimageid");
String v_primarycontactid_value = jsonResponse.stringOf("value[i]._primarycontactid_value");
int importsequencenumber = jsonResponse.IntOf("value[i].importsequencenumber");
String v_owningteam_value = jsonResponse.stringOf("value[i]._owningteam_value");
boolean routecase = jsonResponse.BoolOf("value[i].routecase");
boolean blockedprofile = jsonResponse.BoolOf("value[i].blockedprofile");
int statecode = jsonResponse.IntOf("value[i].statecode");
String int_casecategory = jsonResponse.stringOf("value[i].int_casecategory");
String entityimage_timestamp = jsonResponse.stringOf("value[i].entityimage_timestamp");
int firstresponseslastatus = jsonResponse.IntOf("value[i].firstresponseslastatus");
String traversedpath = jsonResponse.stringOf("value[i].traversedpath");
String int_actualsatisfaction = jsonResponse.stringOf("value[i].int_actualsatisfaction");
String v_int_associatedproduct_value = jsonResponse.stringOf("value[i]._int_associatedproduct_value");
String v_customerid_value = jsonResponse.stringOf("value[i]._customerid_value");
String entityimage = jsonResponse.stringOf("value[i].entityimage");
String v_entitlementid_value = jsonResponse.stringOf("value[i]._entitlementid_value");
boolean activitiescomplete = jsonResponse.BoolOf("value[i].activitiescomplete");
String new_upsellreferral = jsonResponse.stringOf("value[i].new_upsellreferral");
int statuscode = jsonResponse.IntOf("value[i].statuscode");
String processid = jsonResponse.stringOf("value[i].processid");
String v_contractdetailid_value = jsonResponse.stringOf("value[i]._contractdetailid_value");
int int_customereffort = jsonResponse.IntOf("value[i].int_customereffort");
String responseby = jsonResponse.stringOf("value[i].responseby");
String v_transactioncurrencyid_value = jsonResponse.stringOf("value[i]._transactioncurrencyid_value");
String sentimentvalue = jsonResponse.stringOf("value[i].sentimentvalue");
String v_slaid_value = jsonResponse.stringOf("value[i]._slaid_value");
String influencescore = jsonResponse.stringOf("value[i].influencescore");
String v_firstresponsebykpiid_value = jsonResponse.stringOf("value[i]._firstresponsebykpiid_value");
String utcconversiontimezonecode = jsonResponse.stringOf("value[i].utcconversiontimezonecode");
String numberofchildincidents = jsonResponse.stringOf("value[i].numberofchildincidents");
String incidentid = jsonResponse.stringOf("value[i].incidentid");
String new_casecategory = jsonResponse.stringOf("value[i].new_casecategory");
String v_owningbusinessunit_value = jsonResponse.stringOf("value[i]._owningbusinessunit_value");
int casetypecode = jsonResponse.IntOf("value[i].casetypecode");
int resolvebyslastatus = jsonResponse.IntOf("value[i].resolvebyslastatus");
String createdon = jsonResponse.stringOf("value[i].createdon");
int severitycode = jsonResponse.IntOf("value[i].severitycode");
String exchangerate = jsonResponse.stringOf("value[i].exchangerate");
String v_subjectid_value = jsonResponse.stringOf("value[i]._subjectid_value");
int servicestage = jsonResponse.IntOf("value[i].servicestage");
String description = jsonResponse.stringOf("value[i].description");
String lastonholdtime = jsonResponse.stringOf("value[i].lastonholdtime");
String actualserviceunits = jsonResponse.stringOf("value[i].actualserviceunits");
String title = jsonResponse.stringOf("value[i].title");
String v_createdby_value = jsonResponse.stringOf("value[i]._createdby_value");
boolean isdecrementing = jsonResponse.BoolOf("value[i].isdecrementing");
String v_modifiedonbehalfby_value = jsonResponse.stringOf("value[i]._modifiedonbehalfby_value");
int customersatisfactioncode = jsonResponse.IntOf("value[i].customersatisfactioncode");
String stageid = jsonResponse.stringOf("value[i].stageid");
String v_kbarticleid_value = jsonResponse.stringOf("value[i]._kbarticleid_value");
String entityimage_url = jsonResponse.stringOf("value[i].entityimage_url");
boolean firstresponsesent = jsonResponse.BoolOf("value[i].firstresponsesent");
int incidentstagecode = jsonResponse.IntOf("value[i].incidentstagecode");
String customerid_accountAccountid = jsonResponse.stringOf("value[i].customerid_account.accountid");
String customerid_accountName = jsonResponse.stringOf("value[i].customerid_account.name");
i = i + 1;
}
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
{
"@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"
}
}
]
}