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"
LOCAL loRest
LOCAL lnSuccess
LOCAL lnBTls
LOCAL lnPort
LOCAL lnBAutoReconnect
LOCAL loSbResponseBody
LOCAL lnRespStatusCode
LOCAL loJsonResponse
LOCAL i
LOCAL lnCount_i
LOCAL lcOdataContext
LOCAL lcOdataEtag
LOCAL lcV_resolvebykpiid_value
LOCAL lnCustomercontacted
LOCAL lcV_accountid_value
LOCAL lnPrioritycode
LOCAL lcV_msdyn_incidenttype_value
LOCAL lnCaseorigincode
LOCAL lcModifiedon
LOCAL lcV_parentcaseid_value
LOCAL lcV_slainvokedid_value
LOCAL lcOverriddencreatedon
LOCAL lnIsescalated
LOCAL lcInt_paraturecasenumber
LOCAL lnCheckemail
LOCAL lcFollowupby
LOCAL lcTicketnumber
LOCAL lnVersionnumber
LOCAL lcV_modifiedby_value
LOCAL lcBilledserviceunits
LOCAL lnDecremententitlementterm
LOCAL lcOnholdtime
LOCAL lcResolveby
LOCAL lnInt_upsellreferral
LOCAL lcMessagetypecode
LOCAL lcEmailaddress
LOCAL lnMerged
LOCAL lcInt_surveryparticipation
LOCAL lcContractservicelevelcode
LOCAL lcV_createdonbehalfby_value
LOCAL lcV_contactid_value
LOCAL lcV_existingcase_value
LOCAL lcProductserialnumber
LOCAL lcV_owninguser_value
LOCAL lcInt_effortnum
LOCAL lcEscalatedon
LOCAL lcV_productid_value
LOCAL lnFollowuptaskcreated
LOCAL lcV_ownerid_value
LOCAL lcNew_actualsatisfaction
LOCAL lcV_socialprofileid_value
LOCAL lcV_createdbyexternalparty_value
LOCAL lcV_contractid_value
LOCAL lcV_modifiedbyexternalparty_value
LOCAL lcV_masterid_value
LOCAL lnTimezoneruleversionnumber
LOCAL lcEntityimageid
LOCAL lcV_primarycontactid_value
LOCAL lnImportsequencenumber
LOCAL lcV_owningteam_value
LOCAL lnRoutecase
LOCAL lnBlockedprofile
LOCAL lnStatecode
LOCAL lcInt_casecategory
LOCAL lcEntityimage_timestamp
LOCAL lnFirstresponseslastatus
LOCAL lcTraversedpath
LOCAL lcInt_actualsatisfaction
LOCAL lcV_int_associatedproduct_value
LOCAL lcV_customerid_value
LOCAL lcEntityimage
LOCAL lcV_entitlementid_value
LOCAL lnActivitiescomplete
LOCAL lcNew_upsellreferral
LOCAL lnStatuscode
LOCAL lcProcessid
LOCAL lcV_contractdetailid_value
LOCAL lnInt_customereffort
LOCAL lcResponseby
LOCAL lcV_transactioncurrencyid_value
LOCAL lcSentimentvalue
LOCAL lcV_slaid_value
LOCAL lcInfluencescore
LOCAL lcV_firstresponsebykpiid_value
LOCAL lcUtcconversiontimezonecode
LOCAL lcNumberofchildincidents
LOCAL lcIncidentid
LOCAL lcNew_casecategory
LOCAL lcV_owningbusinessunit_value
LOCAL lnCasetypecode
LOCAL lnResolvebyslastatus
LOCAL lcCreatedon
LOCAL lnSeveritycode
LOCAL lcExchangerate
LOCAL lcV_subjectid_value
LOCAL lnServicestage
LOCAL lcDescription
LOCAL lcLastonholdtime
LOCAL lcActualserviceunits
LOCAL lcTitle
LOCAL lcV_createdby_value
LOCAL lnIsdecrementing
LOCAL lcV_modifiedonbehalfby_value
LOCAL lnCustomersatisfactioncode
LOCAL lcStageid
LOCAL lcV_kbarticleid_value
LOCAL lcEntityimage_url
LOCAL lnFirstresponsesent
LOCAL lnIncidentstagecode
LOCAL lcCustomerid_accountAccountid
LOCAL lcCustomerid_accountName
loRest = CreateObject('Chilkat_9_5_0.Rest')
* URL: https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/incidents
lnBTls = 1
lnPort = 443
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("my-dynamics-domain.api.crm.dynamics.com",lnPort,lnBTls,lnBAutoReconnect)
IF (lnSuccess <> 1) THEN
? "ConnectFailReason: " + STR(loRest.ConnectFailReason)
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
loRest.AddQueryParam("$expand","customerid_account($select=accountid,name)")
loRest.AddQueryParam("$filter","incidentid eq c49e62a8-90df-e311-9565-a45d36fc5fe8")
loRest.AddHeader("OData-MaxVersion","4.0")
loRest.AddHeader("Accept","application/json")
loRest.AddHeader("OData-Version","4.0")
loRest.AddHeader("Authorization","Bearer DYNAMICS_CRM_ACCESS_TOKEN")
loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loRest.FullRequestNoBodySb("GET","/api/data/v9.0/incidents",loSbResponseBody)
IF (lnSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
RELEASE loSbResponseBody
CANCEL
ENDIF
lnRespStatusCode = loRest.ResponseStatusCode
IF (lnRespStatusCode >= 400) THEN
? "Response Status Code = " + STR(lnRespStatusCode)
? "Response Header:"
? loRest.ResponseHeader
? "Response Body:"
? loSbResponseBody.GetAsString()
RELEASE loRest
RELEASE loSbResponseBody
CANCEL
ENDIF
loJsonResponse = CreateObject('Chilkat_9_5_0.JsonObject')
loJsonResponse.LoadSb(loSbResponseBody)
lcOdataContext = loJsonResponse.StringOf('"@odata.context"')
i = 0
lnCount_i = loJsonResponse.SizeOfArray("value")
DO WHILE i < lnCount_i
loJsonResponse.I = i
lcOdataEtag = loJsonResponse.StringOf('value[i]."@odata.etag"')
lcV_resolvebykpiid_value = loJsonResponse.StringOf("value[i]._resolvebykpiid_value")
lnCustomercontacted = loJsonResponse.BoolOf("value[i].customercontacted")
lcV_accountid_value = loJsonResponse.StringOf("value[i]._accountid_value")
lnPrioritycode = loJsonResponse.IntOf("value[i].prioritycode")
lcV_msdyn_incidenttype_value = loJsonResponse.StringOf("value[i]._msdyn_incidenttype_value")
lnCaseorigincode = loJsonResponse.IntOf("value[i].caseorigincode")
lcModifiedon = loJsonResponse.StringOf("value[i].modifiedon")
lcV_parentcaseid_value = loJsonResponse.StringOf("value[i]._parentcaseid_value")
lcV_slainvokedid_value = loJsonResponse.StringOf("value[i]._slainvokedid_value")
lcOverriddencreatedon = loJsonResponse.StringOf("value[i].overriddencreatedon")
lnIsescalated = loJsonResponse.BoolOf("value[i].isescalated")
lcInt_paraturecasenumber = loJsonResponse.StringOf("value[i].int_paraturecasenumber")
lnCheckemail = loJsonResponse.BoolOf("value[i].checkemail")
lcFollowupby = loJsonResponse.StringOf("value[i].followupby")
lcTicketnumber = loJsonResponse.StringOf("value[i].ticketnumber")
lnVersionnumber = loJsonResponse.IntOf("value[i].versionnumber")
lcV_modifiedby_value = loJsonResponse.StringOf("value[i]._modifiedby_value")
lcBilledserviceunits = loJsonResponse.StringOf("value[i].billedserviceunits")
lnDecremententitlementterm = loJsonResponse.BoolOf("value[i].decremententitlementterm")
lcOnholdtime = loJsonResponse.StringOf("value[i].onholdtime")
lcResolveby = loJsonResponse.StringOf("value[i].resolveby")
lnInt_upsellreferral = loJsonResponse.BoolOf("value[i].int_upsellreferral")
lcMessagetypecode = loJsonResponse.StringOf("value[i].messagetypecode")
lcEmailaddress = loJsonResponse.StringOf("value[i].emailaddress")
lnMerged = loJsonResponse.BoolOf("value[i].merged")
lcInt_surveryparticipation = loJsonResponse.StringOf("value[i].int_surveryparticipation")
lcContractservicelevelcode = loJsonResponse.StringOf("value[i].contractservicelevelcode")
lcV_createdonbehalfby_value = loJsonResponse.StringOf("value[i]._createdonbehalfby_value")
lcV_contactid_value = loJsonResponse.StringOf("value[i]._contactid_value")
lcV_existingcase_value = loJsonResponse.StringOf("value[i]._existingcase_value")
lcProductserialnumber = loJsonResponse.StringOf("value[i].productserialnumber")
lcV_owninguser_value = loJsonResponse.StringOf("value[i]._owninguser_value")
lcInt_effortnum = loJsonResponse.StringOf("value[i].int_effortnum")
lcEscalatedon = loJsonResponse.StringOf("value[i].escalatedon")
lcV_productid_value = loJsonResponse.StringOf("value[i]._productid_value")
lnFollowuptaskcreated = loJsonResponse.BoolOf("value[i].followuptaskcreated")
lcV_ownerid_value = loJsonResponse.StringOf("value[i]._ownerid_value")
lcNew_actualsatisfaction = loJsonResponse.StringOf("value[i].new_actualsatisfaction")
lcV_socialprofileid_value = loJsonResponse.StringOf("value[i]._socialprofileid_value")
lcV_createdbyexternalparty_value = loJsonResponse.StringOf("value[i]._createdbyexternalparty_value")
lcV_contractid_value = loJsonResponse.StringOf("value[i]._contractid_value")
lcV_modifiedbyexternalparty_value = loJsonResponse.StringOf("value[i]._modifiedbyexternalparty_value")
lcV_masterid_value = loJsonResponse.StringOf("value[i]._masterid_value")
lnTimezoneruleversionnumber = loJsonResponse.IntOf("value[i].timezoneruleversionnumber")
lcEntityimageid = loJsonResponse.StringOf("value[i].entityimageid")
lcV_primarycontactid_value = loJsonResponse.StringOf("value[i]._primarycontactid_value")
lnImportsequencenumber = loJsonResponse.IntOf("value[i].importsequencenumber")
lcV_owningteam_value = loJsonResponse.StringOf("value[i]._owningteam_value")
lnRoutecase = loJsonResponse.BoolOf("value[i].routecase")
lnBlockedprofile = loJsonResponse.BoolOf("value[i].blockedprofile")
lnStatecode = loJsonResponse.IntOf("value[i].statecode")
lcInt_casecategory = loJsonResponse.StringOf("value[i].int_casecategory")
lcEntityimage_timestamp = loJsonResponse.StringOf("value[i].entityimage_timestamp")
lnFirstresponseslastatus = loJsonResponse.IntOf("value[i].firstresponseslastatus")
lcTraversedpath = loJsonResponse.StringOf("value[i].traversedpath")
lcInt_actualsatisfaction = loJsonResponse.StringOf("value[i].int_actualsatisfaction")
lcV_int_associatedproduct_value = loJsonResponse.StringOf("value[i]._int_associatedproduct_value")
lcV_customerid_value = loJsonResponse.StringOf("value[i]._customerid_value")
lcEntityimage = loJsonResponse.StringOf("value[i].entityimage")
lcV_entitlementid_value = loJsonResponse.StringOf("value[i]._entitlementid_value")
lnActivitiescomplete = loJsonResponse.BoolOf("value[i].activitiescomplete")
lcNew_upsellreferral = loJsonResponse.StringOf("value[i].new_upsellreferral")
lnStatuscode = loJsonResponse.IntOf("value[i].statuscode")
lcProcessid = loJsonResponse.StringOf("value[i].processid")
lcV_contractdetailid_value = loJsonResponse.StringOf("value[i]._contractdetailid_value")
lnInt_customereffort = loJsonResponse.IntOf("value[i].int_customereffort")
lcResponseby = loJsonResponse.StringOf("value[i].responseby")
lcV_transactioncurrencyid_value = loJsonResponse.StringOf("value[i]._transactioncurrencyid_value")
lcSentimentvalue = loJsonResponse.StringOf("value[i].sentimentvalue")
lcV_slaid_value = loJsonResponse.StringOf("value[i]._slaid_value")
lcInfluencescore = loJsonResponse.StringOf("value[i].influencescore")
lcV_firstresponsebykpiid_value = loJsonResponse.StringOf("value[i]._firstresponsebykpiid_value")
lcUtcconversiontimezonecode = loJsonResponse.StringOf("value[i].utcconversiontimezonecode")
lcNumberofchildincidents = loJsonResponse.StringOf("value[i].numberofchildincidents")
lcIncidentid = loJsonResponse.StringOf("value[i].incidentid")
lcNew_casecategory = loJsonResponse.StringOf("value[i].new_casecategory")
lcV_owningbusinessunit_value = loJsonResponse.StringOf("value[i]._owningbusinessunit_value")
lnCasetypecode = loJsonResponse.IntOf("value[i].casetypecode")
lnResolvebyslastatus = loJsonResponse.IntOf("value[i].resolvebyslastatus")
lcCreatedon = loJsonResponse.StringOf("value[i].createdon")
lnSeveritycode = loJsonResponse.IntOf("value[i].severitycode")
lcExchangerate = loJsonResponse.StringOf("value[i].exchangerate")
lcV_subjectid_value = loJsonResponse.StringOf("value[i]._subjectid_value")
lnServicestage = loJsonResponse.IntOf("value[i].servicestage")
lcDescription = loJsonResponse.StringOf("value[i].description")
lcLastonholdtime = loJsonResponse.StringOf("value[i].lastonholdtime")
lcActualserviceunits = loJsonResponse.StringOf("value[i].actualserviceunits")
lcTitle = loJsonResponse.StringOf("value[i].title")
lcV_createdby_value = loJsonResponse.StringOf("value[i]._createdby_value")
lnIsdecrementing = loJsonResponse.BoolOf("value[i].isdecrementing")
lcV_modifiedonbehalfby_value = loJsonResponse.StringOf("value[i]._modifiedonbehalfby_value")
lnCustomersatisfactioncode = loJsonResponse.IntOf("value[i].customersatisfactioncode")
lcStageid = loJsonResponse.StringOf("value[i].stageid")
lcV_kbarticleid_value = loJsonResponse.StringOf("value[i]._kbarticleid_value")
lcEntityimage_url = loJsonResponse.StringOf("value[i].entityimage_url")
lnFirstresponsesent = loJsonResponse.BoolOf("value[i].firstresponsesent")
lnIncidentstagecode = loJsonResponse.IntOf("value[i].incidentstagecode")
lcCustomerid_accountAccountid = loJsonResponse.StringOf("value[i].customerid_account.accountid")
lcCustomerid_accountName = loJsonResponse.StringOf("value[i].customerid_account.name")
i = i + 1
ENDDO
RELEASE loRest
RELEASE loSbResponseBody
RELEASE loJsonResponse
{
"@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"
}
}
]
}