{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Report Pagination","type":"basic","slug":"report-pagination","excerpt":"","body":"Pagination is supported in both the [Reporting API](doc:get-report-data) and the [Custom Reporting API](doc:run-custom-report). This feature allows you to define the limit on the number of rows returned per page and divide the report results over several requests. This page goes over have to take advantage of this feature. \n\n## Step 1: Get the first page of results\nTo define the limit on the number of rows returned per page, use the `pageSize` parameter in the first API request. \n\nFor example: \n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/report/TransactionDetail?period=LAST_WEEK&pageSize=5 \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n \"language\": \"curl\",\n \"name\": \"Reporting API \"\n },\n {\n \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/report/dynamic/12141?period=THIS_MONTH&pageSize=50 \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n \"language\": \"curl\",\n \"name\": \"Custom Reporting API\"\n }\n ]\n}\n[/block]\n**Note:** If you do not specify page size, the maximum size is 5,000 rows by default.\n\nThe response includes the report data and headers that indicate the token for the next page of results, the start row of the current response, and the total number of rows. \n\nFor example:\n\n```\n next-page-token: bmV4dHBhZ2V0b2tlbg==\n start-row: 1\n total-row-count: 3019\n```\n\n## Step 2: Get the next page of results\nTo get the next page of results, insert the value from `next-page-token` from the previous step into the query string. Optionally, you can include the `format` parameter. No other parameters are required.\n\nFor example:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/report/TransactionDetail?nextPageToken=bmV4dHBhZ2V0b2tlbg== \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n \"language\": \"curl\",\n \"name\": \"Reporting API \"\n },\n {\n \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/report/dynamic/12141?nextPageToken=bmV4dHBhZ2V0b2tlbg== \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n \"language\": \"curl\",\n \"name\": \"Custom Reporting API\"\n }\n ]\n}\n[/block]\n\n**Note:** The last page of the results does not include the `next-page-token` header.","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5fcebf1fd1caaa015bdf8999","createdAt":"2020-12-07T23:47:43.455Z","user":"5ea72d649148ff00653f6bbc","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Reporting API","slug":"reporting-api","order":1,"from_sync":false,"reference":false,"_id":"5fa1893ed2a2370028d2421f","version":"5fa1893ed2a2370028d24282","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-04-21T12:52:47.551Z","__v":0},"version":{"version":"8976-Tools","version_clean":"8976.0.0-Tools","codename":"3.36 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5fa1893ed2a2370028d2421e","5fa1893ed2a2370028d2421f","5fa1893ed2a2370028d24220","5fa1893ed2a2370028d24221","5fa1893ed2a2370028d24222","5fa1893ed2a2370028d24223","5fa1893ed2a2370028d24224","5fa1893ed2a2370028d24225","5fa1893ed2a2370028d24226","5fa1893ed2a2370028d24227","5fa1893ed2a2370028d24228","5fa1893ed2a2370028d24229","5b34c737e0dca2000311de6a","5fa1893ed2a2370028d2422a","5fa1893ed2a2370028d2422b","5fa1893ed2a2370028d2422c","5fa1893ed2a2370028d2422d","5fa1893ed2a2370028d2422e","5fa1893ed2a2370028d2422f","5fa18956dd369d003cb51fc6"],"_id":"5fa1893ed2a2370028d24282","project":"57336fd5a6a9c40e00e13a0b","__v":1,"forked_from":"5f4d276c4ff932005f3e3b86","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":0,"parentDoc":null}
Report Pagination
Pagination is supported in both the Reporting API and the Custom Reporting API. This feature allows you to define the limit on the number of rows returned per page and divide the report results over several requests. This page goes over have to take advantage of this feature.
Step 1: Get the first page of results
To define the limit on the number of rows returned per page, use the pageSize
parameter in the first API request.
For example:
curl -v -X GET https://sandbox.bluesnap.com/services/2/report/TransactionDetail?period=LAST_WEEK&pageSize=5 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X GET https://sandbox.bluesnap.com/services/2/report/dynamic/12141?period=THIS_MONTH&pageSize=50 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
Note: If you do not specify page size, the maximum size is 5,000 rows by default.
The response includes the report data and headers that indicate the token for the next page of results, the start row of the current response, and the total number of rows.
For example:
next-page-token: bmV4dHBhZ2V0b2tlbg==
start-row: 1
total-row-count: 3019
Step 2: Get the next page of results
To get the next page of results, insert the value from next-page-token
from the previous step into the query string. Optionally, you can include the format
parameter. No other parameters are required.
For example:
curl -v -X GET https://sandbox.bluesnap.com/services/2/report/TransactionDetail?nextPageToken=bmV4dHBhZ2V0b2tlbg== \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X GET https://sandbox.bluesnap.com/services/2/report/dynamic/12141?nextPageToken=bmV4dHBhZ2V0b2tlbg== \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
Note: The last page of the results does not include the next-page-token
header.