-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation is lacking for handling of "@odata.nextLink" responses #690
Comments
Hello, in a paginated response fromthe API, the odata nextlink can be used to get the data of the next page. calls = 0
while calls < 5:
response = requests.get(url, headers=headers)
print(calls)
data = response.json()
if "@odata.nextLink" in data:
url = data["@odata.nextLink"]
elif "@odata.deltaLink" in data:
print(data["@odata.deltaLink"])
return data["@odata.deltaLink"]
else:
raise Exception("Unexpected response: no nextLink or deltaLink")
calls += 1 The condition in the loop can be anything that suits your use case |
Hey @shemogumbe thank you for the response, Your example does not seem to be using the 'SignInCollectionResponse' object from the
.. isn't the whole point of the sdk that it handles things like odata.nextlink functionality? Below the function I'm using
|
Is your feature request related to a problem? Please describe.
Documentation is lacking for handling of "@odata.nextLink" responses i.e. https://learn.microsoft.com/en-us/graph/api/signin-list?view=graph-rest-1.0&tabs=python#response-2
Describe the solution you'd like
Add an example how to retrieve the full data response
The text was updated successfully, but these errors were encountered: