Get Business Objects by Number of Records
4 min
fetches business object records based on the defined number of records to be displayed for example, you can define to fetch 50 records by default, the application fetches 25 records and the maximum number of records you can define to fetch is 100 base url https //{tenant url}/api/odata/businessobject/{business object name}?$top={number of records to display} ensure the business object name is suffixed with an "s" get business object by number of records example here is an example to fetch the defined number of incident records url https //{tenant url}/api/odata/businessobject/incidents?$top=40 \<font color="#ffffff">method\</font> get header name authorization jtw token/session key/rest api key \<font color="#ffffff">status code\</font> 200 \<font color="#ffffff">response payload\</font> click to view the response payload the response displayed is only a sample, it does not have the exact number of records defined to fetch nor all the fields are displayed { "@odata context" " https //ism mastertest tenant2 ivanticlouddev com/api/odata/$metadata#incidents ", "@odata count" 572, "value" \[ { "actualcategory valid" "14348c1ffa044d8ab1e93005b4a0a287", "actualcategory" "missing item", "createdby" "jclerk", "createddatetime" "2011 07 24t23 42 48z ", "email" " kdavidson\@saasitdemo com ", }, { "actualcategory valid" null, "actualcategory" null, "createdby" "email listener", "createddatetime" "2019 07 05t09 25 41z ", "email" " sai sagar\@ivanti com ", }, { "actualcategory valid" "b30a0bc3f3174b22b328d742c24b59c4", "actualcategory" "account lockout", "createdby" "admin", "createddatetime" "2011 09 20t08 42 00z ", "email" " mhendrics\@saasitdemo com ", }, { "actualcategory valid" "4a550ad1778746fcba65a19a630ac2c9", "actualcategory" "printer failure", "createdby" "admin", "createddatetime" "2011 03 25t20 42 37z ", "email" " sharon lowe\@saasitdemo com ", }, { "actualcategory valid" "b30a0bc3f3174b22b328d742c24b59c4", "actualcategory" "account lockout", "createdby" "admin", "createddatetime" "2011 05 10t04 42 00z ", "email" " blevitt\@saasitdemo com ", }, the data displayed in the response payload is only a sample data, it does not contain the full list of responses but only a few are shown for sample unsuccessful responses empty top value scenario trying to fetch records without providing the top value https //{tenant url}/api/odata/businessobject/incidents?$top= header name authorization sessionkey code ism 5000 description invalid request message { "code" "ism 5000", "description" "internal server error", "message" "", "help" "" } \<font color="#ffffff">http status code\</font> 500 querying more 100 records scenario trying to fetch more than 100 records https //{tenant url}/api/odata/businessobject/incidents?$top=120 header name authorization sessionkey code ism 5000 description invalid request message \[ "you cannot query more than 100 records " ] \<font color="#ffffff">http status code\</font> 500
