Update a Business Object
4 min
you can update details of a business object such as a change, problem, or incident base url https //{tenant url}/api/odata/businessobject/{business object name}('{business object unique key}') ensure the business object name is suffixed with an "s" update a business object example here is an example to update a change by its unique id url https //{tenant url}/api/odata/businessobject/changes('02818a8426c9402e8dfe7c8d3132f783') \<font color="#ffffff">method\</font> put/patch the put and patch methods have the same request payload, despite performing different operations header name authorization jtw token/session key/rest api key status code 200 \<font color="#ffffff">response payload\</font> click to view the response { "@odata context" " https //tatnet ivanti com/api/odata/change/$metadata#changes/$entity ", "acceptanceduedate" "0001 01 01t00 00 00z ", "accepttimeout" "0001 01 01t00 00 00z ", "backoutplanattached" false, "ballotcount" null, "businessfunction valid" "", "businessfunction" "", "category valid" "e0234286776b43c39231635c7066f369", "category" "software", "changenumber" 10173, "closedby" null, "closedcode valid" "", "closedcode" "", "closeddatetime" "0001 01 01t00 00 00z ", "completedby" "", "createdby" "admin", "createdbyrecid" "fb884d18f7b746a0992880f2dffe749c", "createddatetime" "2011 10 09t01 30 36 +05 30 ", "directcost" 0, "emergency" false, "estimatedcost" 0, "externalcalendarlinkid" "", "externaltasklinkid" "", "finalstate" "false", "impact valid" "1affc174c7ea4ab79cca6b15eb67006d", "impact" "medium", "lastmodby" "rmatthews", "lastmoddatetime" "2011 11 24t01 30 36 +05 30 ", "owner valid" "8c50ba8c88d04afe8288f9931dca7ce8", "owner" "jsmith", "ownerteam valid" "2e4babd54fb9420d94f836f0d9b80c47", "ownerteam" "service desk", "ownertype" "profile employee", "parentlink category" "", "parentlink recid" "", "parentlink" null, "priority" "3", "reason valid" "", "reason" "", "recid" "008e3506af3f4cc190bc95523645d968", "requestedby" "paul h chang", "requestorlink category" "employee", "requestorlink recid" "8a6eada5906f4f4bbcc8f47cc126f374", "requestorlink" "8a6eada5906f4f4bbcc8f47cc126f374", "scheduledenddate" "2011 12 04t01 30 36 +05 30 ", "scheduledstartdate" "2011 11 29t01 30 36 +05 30 ", "service valid" null, "service" "", "status valid" "f93826f7e4394b1e8c8a6ca2c3f07ed3", "status" "pending approval", "subject" "installation of office 2010 compatibility pack", "targetbreach" false, "targetdate" "0001 01 01t00 00 00z ", "typeofchange valid" "e7663afb13cc47e6bb13de2dfc66cd8d", "typeofchange" "significant", "urgency valid" "44021b6cc6e44e598868c4b3306053ae", "sponsor valid" "d844686d74224f159eafa7f11d0792ea", "sponsor" "allen w cope", "risklevel valid" "3548d4c1230b491dab1d315aa93902b5", "risklevel" "low", "riskcataloglink category" "", "riskcataloglink recid" "", "riskcataloglink" null, "releaselink category" "", "releaselink recid" "", "releaselink" "", "triggerchangestoci" "0001 01 01t00 00 00z ", "requesterlocation" "apac china", "requesterphone" "+86 10 8520 0424", "cost" 182, "totaltimespent" 160, "isunread" false } unsuccessful responses empty object id scenario to update a change, the object id provided is empty or a white space example https //{tenant url}/api/odata/businessobject/changes(' ') header name authorization sessionkey \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message \[ "invalid business object key" ], \<font color="#ffffff">http status code\</font> 400 invalid object id scenario when updating a change, the object id provided is invalid examples https //{teannt url}/api/odata/businessobject/changes('1234') https //{tenant url}/api/odata/businessobject/changes('random') header name authorization sessionkey \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message \[ "record '1234' cannot be found in the business object 'change'" ], \<font color="#ffffff">http status code\</font> 400 key value pair does not exist scenario when updating a valid business object instance with a proper key, an invalid request body or key value pair is provided, which are not part of business object field definition example https //{tenant url}/api/odata/businessobject/changes('05b5cd2dfae54d86a04c74dbf616c1de') header name authorization sessionkey http put/patch request payload is {"name" "test"} \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message \[ "field 'name' does not exist in the business object 'change#'" ], \<font color="#ffffff">http status code\</font> 400 unhandled exception scenario when updating a valid business object instance with a proper key and valid request body, but for some reason unhandled code is provided and if it fails to update header name authorization sessionkey \<font color="#ffffff">code\</font> ism 5000 description internal server error message \[ "the server encountered an internal error please retry the request " ], \<font color="#ffffff">http status code\</font> 500
