I'm trying to get a list of users through the API and even using the exact code from the documentation its not working. I'm using Python to make the request and when I run this code
while url:
response = requests.get(url, auth=auth, params=params)
data = response.json()
# do something with the data
for user in data['users']:
print(user['name'])
if data['meta']['has_more']:
params['page[after]'] = data['meta']['after_cursor']
else:
url = None
I get 'error': "Couldn't authenticate you".
It only breaks when it's in the loop, if I try to pull a single page outside the loop it works no issue, but if I try to loop it I get nothing.
Any assistance with this error is appreciated.
While in the loop, do you also get a successful response from the first request? Or does the first request fail with this error?