Articles in this section
Category / Section

Ensure pagination for "next token" type in Web Connector

Published:

If you are unsure about the data count and to verify that pagination is occurring on the API, it is advised to limit the iteration to a maximum of 1 and review the record count in the Preview section. This step will assist in identifying the quantity of data entries displayed on a single page. By analyzing this data, one can make a comparison by calculating the product of the maximum iterations and the data count.

Sample API and response for next token:

API:

https://www.googleapis.com/adsense/v1.4/accounts/{:accountId}/adclients?maxResults=2

Response:

    {
    "data": {
    "records":{
    "value": [
    {
    "Id": 1111,
    "ProjectName": "Sample 1"
    },
    {
    "Id": 2222,
    "ProjectName": "Sample 2"
    }
    ],
    "nextPageToken": "aTdoe*T3gdjuUwjbdIte"
    }
    }
    }     

image.png

The “Next token” has been set in the image above, however, the “Max Iteration” has been limited to 1, resulting in only 1 page of data being retrieved from the API. To retrieve more data, you can modify the connection and increase the number of iterations to ensure that the API is paginated based on the count specified, and the data count will be updated accordingly.

Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
GR
Written by Gayathri Ravichandran
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied