Hello,
I am not sure what I am doing wrong. This code snippet works for the first and second page, but the third page just errors out with Backend Error. Below is the snippet code modified from the sample audit code to loop to get more than two pages (/samples/audit/audit.py). I am using the google-api-python-client-1.0beta8 libraries.
Error:
apiclient.errors.HttpError: <HttpError 503 when requesting
Code:
activities = service.activities()
# Retrieve the first two activities
#print 'Retrieving the first 2 activities...'
activity_list = activities.list(
applicationId='207535951991', customerId='<CUSTID>', maxResults='1',
print_activities(activity_list)
pages = range(2)
for i in pages:
# Now retrieve the next 2 events
match = re.search('(?<=continuationToken=).+$', activity_list['next'])
if match is not None:
next_token = match.group(0)
#print '\nRetrieving the next 2 activities...'
activity_list = activities.list(
applicationId='207535951991', customerId='<CUSTID>',
maxResults='1', actorEmail='<USERNAME>@
my.fit.edu',
continuationToken=next_token).execute()
print_activities(activity_list)