Pagination
Split the response into several pages. Available in all Adfox API versions. Pagination is used in all requests.
Request format
You can set up pagination using two parameters:
https://adfox.yandex.com/api/v1
? [offset=<integer>]
& [limit=<integer>]
|
Number of objects in the list to skip. Default value: |
|
Number of objects per page. Default value: Maximum value: |
Alert
Pagination is used in all requests. If the limit
value isn't passed in the request, the default value of 10
is applied.
For example:
Request a list of all campaigns, with 25 campaigns per page.
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=0&limit=25
Request to view the second page with 25 campaigns:
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=25&limit=25
Response format
A pagination block has been added in the response to the request. It has information about the total number of pages, which page the response is currently on, the total number of objects, the number of objects on this page, and links to the first, previous, next, and last pages.
Sample pagination block in the response:
...
<links>
<first>
<![CDATA[
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=0&limit=5
]]>
</first>
<prev>
<![CDATA[
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=0&limit=5
]]>
</prev>
<next>
<![CDATA[
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=10&limit=5
]]>
</next>
<last>
<![CDATA[
https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=campaign&offset=80&limit=5
]]>
</last>
<limit>5</limit>
<offset>5</offset>
<total_pages>17</total_pages>
<page>2</page>
<total_rows>85</total_rows>
<rows>5</rows>
</links>
...
Pagination block parameters
|
Link to the first page. |
|
Link to the previous page. |
|
Link to the next page. |
|
Link to the last page. |
|
Total number of pages. |
|
Number of the current page. |
|
Total number of objects. |
|
Number of objects displayed on the page. |
Number of objects in the list to skip.
Default value: 0
.
Number of objects per page.
Default value: 10
.
Maximum value: 1000
.