1 Answer
- Newest
- Most votes
- Most comments
1
I might be misunderstanding as I can't see how API Gateway relates, but the Cognito API's "ListUsers" documentation https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUsers.html says PaginationToken is "An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list" and is optional. The idea is you don't provide it on your first call - you exclude it entirely, you don't pass an empty String. The idiom I use for pagination, which is common in the AWS APIs though a bit inconsistent, is as follows (this is a pseudocode/Python example but the same idea works for all SDKs):
response = some_aws_api(your_params)
while True:
process the response
# check if there's more to retrieve
token = response.get('PaginationToken', '')
if token == '':
break
response = some_aws_api(PaginationToken=token, your_params)
Relevant content
- asked 8 months ago
- asked 2 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago