{"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":"603fec227146110018e1daad","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":"603fec227146110018e1da3e","version":"603fec227146110018e1daaf","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-04-21T12:52:47.551Z","__v":0},"version":{"version":"8976-Tools","version_clean":"8976.0.0-Tools","codename":"3.37 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["603fec227146110018e1da3d","603fec227146110018e1da3e","603fec227146110018e1da3f","603fec227146110018e1da40","603fec227146110018e1da41","603fec227146110018e1da42","603fec227146110018e1da43","603fec227146110018e1da44","603fec227146110018e1da45","603fec227146110018e1da46","603fec227146110018e1da47","603fec227146110018e1da48","5b34c737e0dca2000311de6a","603fec227146110018e1da49","603fec227146110018e1da4a","603fec227146110018e1da4b","603fec227146110018e1da4c","603fec227146110018e1da4d","603fec227146110018e1da4e","603fec227146110018e1da4f"],"_id":"603fec227146110018e1daaf","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"6019bc72944282005e966fd4","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":0,"parentDoc":null}

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.