nextPageToken query parameter. If the response includes a nextPageToken attribute, use it in the nextPageToken query parameter for the next request. Repeat until no nextPageToken is returned.
Example of how to use pagination:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Understanding token-based pagination in e-CROSS APIs
nextPageToken query parameter. If the response includes a nextPageToken attribute, use it in the nextPageToken query parameter for the next request. Repeat until no nextPageToken is returned.
Example of how to use pagination:
# First page
curl -X GET 'https://product.api.e-cross.tech/ext/merchant/skus' \
-H "Authorization: Bearer ${YOUR_TOKEN}"
# Next page (using token from previous response)
curl -X GET "https://product.api.e-cross.tech/ext/merchant/skus?nextPageToken=${TOKEN_FROM_PREVIOUS_RESPONSE}" \
-H "Authorization: Bearer ${YOUR_TOKEN}"
async function getAllSKUs(token) {
let allSKUs = [];
let nextPageToken = null;
do {
const url = nextPageToken
? `https://product.api.e-cross.tech/ext/merchant/skus?nextPageToken=${nextPageToken}`
: 'https://product.api.e-cross.tech/ext/merchant/skus';
const response = await fetch(url, {
headers: { 'Authorization': `Bearer ${token}` }
});
const data = await response.json();
allSKUs = allSKUs.concat(data.skus);
nextPageToken = data.nextPageToken;
} while (nextPageToken);
return allSKUs;
}
import requests
def get_all_skus(token):
all_skus = []
next_page_token = None
while True:
url = 'https://product.api.e-cross.tech/ext/merchant/skus'
params = {}
if next_page_token:
params['nextPageToken'] = next_page_token
response = requests.get(
url,
headers={'Authorization': f'Bearer {token}'},
params=params
)
data = response.json()
all_skus.extend(data['skus'])
next_page_token = data.get('nextPageToken')
if not next_page_token:
break
return all_skus
Was this page helpful?
