Get Business Object by Select
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".
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"}]}, |
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":"[email protected]","FirstCallResolution":false,"Impact_Valid":"1AFFC174C7EA4AB79CCA6B15EB67006D","Impact":"Medium","IncidentNumber":10409,"IsNotification":true,"IsVIP":false,"IsWorkAround":false,"LastModBy":"RThomas","LastModDateTime":"2012-01-28T18:18: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 |
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
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 |
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 |