Create a Business Object
4 min
you can create business objects available out of the box, such as a change, problem, incident, or any custom defined business object of your choice base url https //{tenant url}/api/odata/businessobject/{business object name} ensure the business object name is suffixed with an "s" create a business object example here is an example to create a change business object you can create any other business object of your choice by following the example but ensure you provide the appropriate business object name suffixed with "s" in the businessobject place holder in the url and enter relevant details in the request payload url https //{tenant url}/api/odata/businessobject/changes \<font color="#ffffff">method\</font> post header name authorization jwt token/session key/rest api key \<font color="#ffffff">request payload\</font> click to view the request payload { "category" "computer", "createdby" "admin", "requestorlink recid" "fb884d18f7b746a0992880f2dffe749c", "description" "test", "owner" "bheath", "ownerteam" "accounting", "subject" "test", "ownerteam valid" "8d796372096546ac9008c0edab18ee5f", "owner valid" "147098ad139247f6b177042064c5e39c", "status" "logged", "typeofchange" "minor" } \<font color="#ffffff">status code\</font> 201 \<font color="#ffffff">response payload\</font> click to view the response payload { "@odata context" "http //{tenant url}/api/odata/change/$metadata#changes/$entity", "acceptanceduedate" "0001 01 01t00 00 00z ", "accepttimeout" "0001 01 01t00 00 00z ", "backoutplanattached" false, "ballotcount" null, "businessfunction valid" null, "businessfunction" null, "category valid" "18fcf302685c41a9ab4d4e6c52123a56", "category" "computer", "changenumber" 0, "closedby" null, "closedcode valid" null, "closedcode" null, "closeddatetime" "0001 01 01t00 00 00z ", "completedby" null, "createdby" "admin", "createdbyrecid" "fb884d18f7b746a0992880f2dffe749c", "createddatetime" "2018 08 07t06 06 52 +05 30 ", "directcost" 0, "emergency" false, "estimatedcost" 0, "externalcalendarlinkid" null, "externaltasklinkid" null, "finalstate" "false", "impact valid" null, "impact" null, "lastmodby" "admin", "lastmoddatetime" "2018 08 07t11 36 52 +05 30 ", "owner valid" "147098ad139247f6b177042064c5e39c", "owner" "bheath", "ownerteam valid" "8d796372096546ac9008c0edab18ee5f", "ownerteam" "accounting", "ownertype" null, "parentlink category" null, "parentlink recid" null, "parentlink" null, "priority" null, "reason valid" null, "reason" null, "recid" "67d90c9b57334f84a7b0eeeea3fbc743", "requestedby" "administrator admin", "requestorlink category" "employee", "requestorlink recid" "fb884d18f7b746a0992880f2dffe749c", "requestorlink" "fb884d18f7b746a0992880f2dffe749c", "scheduledenddate" "0001 01 01t00 00 00z ", "scheduledstartdate" "0001 01 01t00 00 00z ", "service valid" null, "service" null, "status valid" "ded387bdb5d843b089246e22563f6446", "status" "logged", "subject" "test", "targetbreach" false, "targetdate" "0001 01 01t00 00 00z ", "typeofchange valid" "b3db5aac881e4d88a97890232c867b4d", "typeofchange" "minor", "urgency valid" null, "urgency" null, "votecount" null, "voteexpirationdatetime" "0001 01 01t00 00 00z ", "votetimeout" "0001 01 01t00 00 00z ", "tempchangetasksubject" null, "changestested" false, "detailscreenname" null, "linktargetcomputer" false, "msgpreexistinventoryitem" null, "isscheduledstartdatefilled" false, "requestoremail" " admin\@saasitdemo com ", "cabmeetingtime" "0001 01 01t00 00 00z ", "calculatedriskquestions" false, "catalogname" null, "cmapprovedby" null, "cmapproveddatetime" "0001 01 01t00 00 00z ", "isciadded" "0001 01 01t00 00 00z ", "isstandardchange" false, "justification valid" null, "justification" null, "noofcilinked" 0, "nooftasks" 0, "nooftaskscompleted" 0, "owneremail" " bheath\@saasitdemo com ", "releasecijscriptholder" null, "requestorfullname" "administrator admin", "risksum" 0, "setchangewindowjscriptholder" null, "sponsor valid" null, "sponsor" null, "risklevel valid" null, "risklevel" null, "riskcataloglink category" null, "riskcataloglink recid" null, "riskcataloglink" null, "releaselink category" null, "releaselink recid" null, "releaselink" null, "triggerchangestoci" "0001 01 01t00 00 00z ", "requesterlocation" "usa", "requesterphone" "7195551254", "mcvoteexpirationdatetime" "0001 01 01t00 00 00z ", "ecabvoteexpirationdatetime" "0001 01 01t00 00 00z ", "cabvoteexpirationdatetime" "0001 01 01t00 00 00z ", "submissiondeadlinedatetime" "0001 01 01t00 00 00z ", "cabreviewdate" "0001 01 01t00 00 00z ", "risktotalscore" null, "readonly" false, "ownerfullname" "bo r heath", "cost" 0, "totaltimespent" 0, "isunread" false } unsuccessful responses empty request body scenario trying to create a business object with empty request body header name authorization sessionkey \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message { "message body cannot be empty " } \<font color="#ffffff">http status code\</font> 400 invalid request body scenario trying to create a business object invalid request body header name authorization sessionkey \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message \[ "invalid business object " ], \<font color="#ffffff">http status code\</font> 400 missing required fields scenario trying to create a business object with missing mandatory fields header name authorization sessionkey \<font color="#ffffff">code\</font> ism 4000 description invalid request payload message \[ "mandatory field "category" value must be provided ", "mandatory field "description" value must be provided ", "mandatory field "status" value must be provided " ] \<font color="#ffffff">http status code\</font> 400 invalid response scenario when trying to create an incident or update an incident, the application fails to save and give a proper response from our api 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
