Skip to content
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

API endpoint users.by_user_id(self.user_id).get().todo.lists.get() does not work #910

Open
Serrindipity opened this issue Oct 1, 2024 · 3 comments
Assignees
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@Serrindipity
Copy link

Describe the bug

I am trying to get all of my task lists. I have my app set up with the ClientSecretCredential flow, and when I call the following:

user = await self.app_client.users.by_user_id(self.user_id).get()

in order to call:

res2= await user.todo.lists.get()

the todo field is None:

User(additional_data={'@odata.context': 'https://graph.microsoft.com/v1.0/$metadata#users/$entity'}, ... todo=None, ... )

which means that the previous call to users.todo.lists errors with AttributeError: 'NoneType' object has no attribute 'lists'

Is this expected behavior? If so, how do I call this endpoint?

Expected behavior

In the graph explorer, the query:

GET https://graph.microsoft.com/v1.0/users/{userid}/todo/lists

returns all of my task lists. I'd like the above code snippets to also return the lists.

How to reproduce

Initialize Graph and app_client as in this tutorial then:

user = await self.app_client.users.by_user_id(USER_ID).get()
res2 = await user.todo.lists.get()

SDK Version

1.8.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

- OS: MacOS Sonoma 14.3

### Other information

_No response_
@Serrindipity Serrindipity added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 1, 2024
@shemogumbe
Copy link
Collaborator

Hello @Serrindipity thanks for using the SDK and for raising this.

I see the todo is None, this could be for a number of reasons, including, there being no registered Tasks for the user in question.

Also, the requestBuilder corresponding to GET https://graph.microsoft.com/v1.0/users/{userid}/todo/lists is https://github.com/microsoftgraph/msgraph-sdk-python/blob/main/msgraph/generated/users/item/todo/lists/lists_request_builder.py

@Serrindipity
Copy link
Author

I know that the endpoint itself works, and that there are tasks to return. As quoted above:

Expected behavior

In the graph explorer, the query:

GET https://graph.microsoft.com/v1.0/users/{userid}/todo/lists

returns all of my task lists. I'd like the above code snippets to also return the lists.

Running the above request in the Graph Explorer returns the necessary lists. As for the request builder, I think the issue is that the user's 'todo' attribute is None, so it never even gets to use the request builder. Not sure where else to go from here.

@Serrindipity
Copy link
Author

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants