Reputation: 968
We have a company account associated to a subscription in Azure. As per this Microsoft documentation(https://learn.microsoft.com/en-us/graph/api/outlookuser-post-tasks?view=graph-rest-beta&tabs=csharp) that account comes under delegated permission type. We need to list other users outlook tasks and create tasks for other users using this company account. We are trying to use Graph API Beta version for this. We are able to perform these operations for signed in user's own tasks. But could not find a way to perform these operation for other users using the above company account.
Is this possible at this moment with Graph API Beta version? If so how to proceed? Otherwise what are the alternatives which fulfills the above requirement?
Upvotes: 2
Views: 1271
Reputation: 151
What you need is application permission, however, Graph OutlookTask API is not yet supported.
Edit: As of today (6/17/2020), it is still not supported. However, there is a request on Microsoft UserVoice.
Upvotes: 2
Reputation: 16498
We cannot use POST /users/{id|userPrincipalName}/outlook/tasks
directly to create tasks for others. It will return an error "A folder id must be specified for delegate access."
Based on my test, there is indeed a way to do it. But in fact this is not a recommended way because of the huge workload.
We assume that you need use UserA to create outlook tasks for UserB.
Detailed steps:
Get https://graph.microsoft.com/beta/users/UserB/outlook/taskfolders
. Record the "id" value, which will be used in the next step. (If you see an error like "The specified object was not found in the store.", please wait until step 1 take effect.)Post
https://graph.microsoft.com/beta/users/UserB/outlook/taskfolders/{ID
from step 2}/tasks
.Upvotes: 4