Is it possible to create a ToDo-Task for other users using a single Admin login?
I have registered an app, and set "API permissions" for Tasks.Read, Tasks.ReadWrite, User.Read.All
I have two users. An admin user, and a test user.
I acquire an access_token for the admin user:
Using the admin's access token as Auth Header "Bearer {{token}}", I can read the test user's profile with GET https://graph.microsoft.com/v1.0/users/testuser@mycompany.onmicrosoft.com
I can successfully create a ToDo-Task for the test user using the test user's access token.
I can successfully create a ToDo-Task for the admin user using the admin user's access token.
However, if I try to create a ToDo-Task for the test user with the admin's access token, I receive this error message ({{ListID}} = List-ID of the test user):
{
"error": {
"code": "invalidRequest",
"message": "Invalid request",
"innerError": {
"code": "ErrorIncorrectRoutingHint",
"date": "2022-07-28T07:49:25",
"request-id": "#######-####-####-####-############",
"client-request-id": "########-####-####-####-############"
}
}
}
What you need is application permission, however, Graph ToDo tasks API is not yet supported.
For more information, check document:https://learn.microsoft.com/en-us/graph/api/resources/todo-overview?view=graph-rest-1.0