Paginating with limits and offsets

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsPaginating with limits and offsets
(Created page with "### Tutorial Use limit and offset parameters to paginate records. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cUR...")
Line 23: Line 23:
 
* Table name: contact
 
* Table name: contact
 
* Limit parameter in API call: <pre>10</pre>
 
* Limit parameter in API call: <pre>10</pre>
* Offset parameter in API call: <pre>11</pre>
+
* Offset parameter in API call: <pre>10</pre>
* Request URL: <pre>https://foo.com/api/v2/db/_table/contact?limit=10&offset=11</pre>
+
* Request URL: <pre>https://foo.com/api/v2/db/_table/contact?limit=10&offset=10</pre>

Revision as of 18:45, 9 October 2015

      1. Tutorial

Use limit and offset parameters to paginate records. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.

      1. API Endpoint
GET https://{url}/api/v2/{api_name}/_table/{table_name}?limit={record_limit}&offset={offset_number}
      1. API Docs Screenshot

Swagger-limit.png Swagger-offset.png

      1. Example - Fetch the first set of ten contact records (records 1 through 10, inclusive)
  • Table name: contact
  • Limit parameter in API call:
    10
  • Offset parameter in API call:
    0
  • Request URL:
    https://foo.com/api/v2/db/_table/contact?limit=10&offset=0
      1. Example - Fetch the second set of ten contact records (records 11 through 20, inclusive)
  • Table name: contact
  • Limit parameter in API call:
    10
  • Offset parameter in API call:
    10
  • Request URL:
    https://foo.com/api/v2/db/_table/contact?limit=10&offset=10