Get Business Object by Select
4 min
there are three methods for using this rest api you can retrieve only the requested fields for a business object; you can retrieve business object records based on defined filter values; you can retrieve only the requested fields for a business object based on the defined filter values base url https //{tenant url}/api/odata/businessobject/{business object name}?$select={names fields to be displayed} ensure the business object name is suffixed with an "s" get business object by select example here is an example to fetch incidents and display only the fields recid and category for the records fetched url https //{tenant url}/api/odata/businessobject/incidents?$select=recid, category method get header name authorization jtw token/session key/rest api key status code 200 response payload {"@odata context" "https //tenant/api/odata/$metadata#incidents(recid,category)","@odata count" 551 ,"value" \[{"recid" "003b58c0b4554e4baa30dfd88876582a","category" "missing item"},{"recid" "019a1ed9c77c4210b7054f47d214c004","category" "account lockout"},{"recid" "030f0da291ec46c9953817f0e22f188e","category" "printer failure"},{"recid" "03c219dbc4ec49e6a5a320de542ad591","category" "account lockout"},{"recid" "03c7e9b0a56f4914b10028702dd52c7c","category" "facility safety"},{"recid" "03d27d44fafc4cd6a0d8f5aacef5a142","category" "voicemail issue"}, {"recid" "0464aabb3fcf4ebc993d4cdc7c3ee8f4","category" "desktop software"},{"recid" "04b5870a4a334412b9f63993868764f5","category" "service desk"},{"recid" "0507d465e1934e07b9a769f131ddcf27","category" "account lockout"},{"recid" "055eb9f659e947e2a54e07bf44caf93e","category" "hardware"},{"recid" "05b5cd2dfae54d86a04c74dbf616c1de","category" "facility security"},{"recid" "06eb5086e87e4ddbba000a37c346dfde","category" "connectivity"},{"recid" "078a9ad7490743f3a0d23a2f85f5288f","category" "corrupt mailbox"},{"recid" "08141bb084e6407b9401be43934d111c","category" "facility safety"},{"recid" "089addf649dc4ed1a8d2b8c067d2ea92","category" "client failure"},{"recid" "08a5cfcdd82e4e888e1151bf1819afe8","category" "account lockout"},{"recid" "093fffa7dfe5496b8c30897dfced0c70","category" "connection failure"},{"recid" "0aad920c8d3f443488b956ddd95b6e58","category" "account lockout"},{"recid" "0c3f818fa1e14f02be1990d340927bca","category" "account lockout"},{"recid" "0cdc422d1780489abea9012d55f0cda8","category" "facility safety"},{"recid" "0e275ce8b1ae42e18de82c7e8b5c0920","category" "missing item"},{"recid" "0e576be9d5ed43b1b6b8ebd4bfa7b90f","category" "account lockout"},{"recid" "0e83898e5bc44236ae7b59e175bcffe5","category" "account lockout"},{"recid" "0ed27e8f176347908a21adccdb7898c5","category" "connectivity"},{"recid" "0f8940c97b8d4831bfa5b89dbc2038f2","category" "network folder failure"}]}, get business object by filter example fetches business object records based on the defined filter values for example, you can fetch just the active incidents base url https //{tenant url}/api/odata/businessobject/{business object name}?$filter={filter field} eq {field value} example url https //{tenant url}/api/odata/businessobject/incidents?$filter=status eq 'active' method get header name authorization jtw token/session key/rest api key status code 200 response payload {"@odata context" "https //tenant/api/odata/$metadata#incidents","@odata count" 51 ,"value" \[{"actualcategory valid" "fb7670462ff94b77ae72445e943f6a3c","actualcategory" "desktop software","category valid" "fb7670462ff94b77ae72445e943f6a3c","category" "desktop software","causecode valid" "","causecode" "","closedby"\ null,"closeddatetime"\ null,"closedduration"\ null,"createdby" "rthomas","createddatetime" "2011 11 18t20 42 38z ","email" " pemerson\@saasitdemo com ","firstcallresolution"\ false,"impact valid" "1affc174c7ea4ab79cca6b15eb67006d","impact" "medium","incidentnumber" 10409 ,"isnotification"\ true,"isvip"\ false,"isworkaround"\ false,"lastmodby" "rthomas","lastmoddatetime" "2012 01 28t18🔞28z","phone" "+44 (0)1635 516700\r\n\r\n","priority valid" "29cd5d78e16f4d82916c3e933a600096","priority" "3","profilefullname" "pam j emerson","profilelink category" "employee","profilelink recid" "acda6cb0265d4c64a7f103aaf2906b2b","profilelink" "acda6cb0265d4c64a7f103aaf2906b2b","recid" "0464aabb3fcf4ebc993d4cdc7c3ee8f4","resolution" "","service valid" "164a2ab6ed554d80b3be0b06c29dcc1a","service" "desktop service","sla" "desktop service (gold) for sales and marketing","slalink category"\ null,"slalink recid" "99ce40fd528a46d78578e47e28f046f6","slalink" "99ce40fd528a46d78578e47e28f046f6","source valid" "ef789ce160e742f99623dbb4d29c045c","source" "phone","status valid" "eab221009ee34ab4bc1d14a42ed099aa","status" "active","subject" "cannot open powerpoint presentation in office 2010","symptom" "word document is password protected how to access it ","urgency valid" "44021b6cc6e44e598868c4b3306053ae","urgency" " etc etc get business object by filter and select example fetches business object records based on the defined filter values and displays only the requested fields for example, you can fetch just the status field for all active incidents base url https //{tenant url}/api/odata/businessobject/{business object name}?$filter={filter field} eq {field value}&}?$select={names fields to be displayed} example url https //{tenant url}/api/odata/businessobject/incidents?$filter=status eq 'active'&$select=status method get header name authorization jtw token/session key/rest api key status code 200 response payload {"@odata context" "https //tenant/api/odata/$metadata#incidents(status)","@odata count" 51 ,"value" \[{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"},{"status" "active"}]} unsuccessful responses empty select value scenario trying to fetch incident without defining the select value https //{tenant url}/api/odata/businessobject/incidents?$select= header name authorization sessionkey code ism 5000 description invalid request message \[ "the select value cannot be empty provide a valid value and try again" ] http status code 500 invalid select value scenario trying to fetch incident with invalid select value https //{tenant url}/api/odata/businessobject/incidents?$filter=status eq 'new' header name authorization sessionkey code ism 4000 description invalid request message \[ "invalid filter value provide a valid filter value and try again" ] http status code 400
