Example 1: Amazon SP API
API Response :
Custom Pagination Script:
import base64
response_parameters = "['items']"
nextToken = api_response['pagination']['nextToken']
result1 = nextToken.rstrip("=")
skip_token = result1
Params:
pageToken : {%skip_token%}
Pre Request Script:
skip_token = ' '
Explanation:
-
api_response→ refers to the entire JSON response returned by the API.-
items→ contains the actual product records. -
pagination.nextToken→ is the token required for the next page of results.
-
-
The script strips trailing
=from thenextTokenbefore assigning it toskip_token. -
The param
pageTokendynamically takes{%skip_token%}. -
The pre-request script initializes
skip_tokenas an empty string for the first call.

