Search code examples
apipaginationbackendless

Backendless returns no paging data


According to API documentation here https://backendless.com/documentation/data/rest/data_search_and_query.htm , backendless shall provide paging info in response body like this

 {
 "nextPage":null,
 "data":[
  {
    "updated":null,
    "created":"02/05/2014 18:13:40 GMT+0000",
    "ownerId":null,
    "objectId":"6FAF3CE5-6F55-1B32-FF83-D333252D0300",
    "name":"Bob",
    "age":20
  },
  {
    "updated":null,
    "created":"02/04/2014 19:40:10 GMT+0000",
    "ownerId":null,
    "objectId":"28325E9F-2DED-D3CA-FFC6-C76911AFBB00",
    "name":"Frank",
    "age":26
  }],
 "offset":0,
 "totalObjects":2
}

However, when I send request to get data from table like this:

https://api.backendless.com/<version>/data/<table-name>

it returns only collection of objects (which should be in "data") and now paging info. Adding page requests:

https://api.backendless.com/<version>/data/<table-name>?pageSize=10&offset=10

returns correct data, but still without paging info. What I'm doing wrong? How can I access paging info?


Solution

  • The docs link you mention is for Backendless version which is being deprecated (there's a warning on the top of the page). Here is a link to the docs for the current version: https://backendless.com/docs/rest/doc.html#data_basic_search

    Indeed, in version 4 we got rid of that additional information in the response to simplify the response object in non-REST clients. But still you can easily determine current params since you're specifying them in the request (or they're zeros in case you're not).