Symptom
You are aware the limitation of maximum 1000 records are retrieved from OData API per page. To fetch more records, you are able to add the $skip and $top parameter. You'd like to know the standard format for C4C OData response so that you can design the custom paging program.
Environment
SAP Cloud for Customer
Resolution
OData Response format for OData API paging, if there are more than 1000 entries, the server includes a <link re"next" href="... element that can be used to retrieve the next 1000 entries. Following is the standard behavior related to OData format.
- By standard what is the response format for OData API which getting from C4C
-> XML format. Once you call the OData API in browser, you are able to see "This XML file does not appear to have any style information associated with it. The document tree is shown below." displayed in Top. - By standard what is the tag for OData API link
-> If there are more than 1000 entries, standard tag will be <link rel="next" href="https://my... in the end. - By standard what is the tag and format if you add the header in Postman
-> If you are using Postman, with header Accept = application/json, it shows json format, with "__next", whatever you select in response body. If you are using Postman, with header Accept = application/xml, it shows xml format, with "<link rel="next" href="https://...", whatever you select in response body. The format and tag only depends on the format setting in header section. - Is it possible to change the format from link
-> Yes, you can calling https://myxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/xxxCollection?$format=json to get a json format with "__next" tag and calling https://myxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/xxxCollection?$format=xml to get a xml format with "<link rel="next" href="https://my..." tag.
Keywords
OData, REST, RESTFUL, API, Format, limitation, Paging, 1000, Json, XML, OData response, tags , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem