We strive to provide enhanced capabilities for the Microsoft Graph To Do task APIs while keeping customer needs at the core. We are thrilled to announce new capabilities like application permissions support, attachment support and ‘startDateTime’ property on To Do task APIs.
Application permissions
Application permissions has been one of the top asks from customers since we released the To Do task APIs. Recently, we have released application permissions for To Do APIs in Graph v1.0. With application permissions, developers can build daemon services and make To Do part of workflows which will not require any interaction for sign-in or consent. Application permission can also be used to create tools that help tenant admins with To Do tasks usage analytics.
Please note, tenant admin consent will be required to access APIs with application permissions.
Scope Name | Entities/API covered |
Tasks.Read.All | Read operation on todoTask, todoTaskList, taskFileAttachment, checklistItems, linkedResource
|
Tasks.ReadWrite.All | Read and write operations on todoTask, todoTaskList, taskFileAttachment, checklistItems, linkedResource
|
Accessing Microsoft Graph APIs using application permissions is an existing pattern. Read more about application permissions in our documentation.
A sample GET task using app permission: https://graph.microsoft.com/v1.0/users/234jk-nse764304-nsfp/todo/lists/AAMkADA1MTHgwAAA=/tasks/721a35e2-35e2-721a-e235-1a72e2351a72
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#tasks/$entity",
"@odata.etag": "W/\"s8/ERWT3WEeFpBGD0bDgAA+TWq9g==\"",
"importance": "low",
"isReminderOn": false,
"status": "notStarted",
"title": "Shop for dinner",
"createdDateTime": "2020-07-22T10:39:03.7937971Z",
"lastModifiedDateTime": "2020-07-22T12:02:10.8835421Z",
"categories": [
"Important",
"Urgent"
],
"id": "721a35e2-35e2-721a-e235-1a72e2351a72",
"body": {
"content": "",
"contentType": "text"
},
"dueDateTime": {
"dateTime": "2020-08-25T04:00:00.0000000",
"timeZone": "UTC"
},
"startDateTime": {
"dateTime": "2020-06-23T04:00:00.0000000",
"timeZone": "UTC"
}
}
Attachments
We are also announcing attachment support on todoTasks in Microsoft Graph v1.0. Now, you can read, upload, and delete file attachments on a task. There are two methods to upload attachments on a task:
- To attach files of any size, create an upload session, and iteratively use PUT call to upload ranges of bytes of the file until you have uploaded the entire file. See attach files to a To Do task for an example.
- If the file size is under 3 MB, you can do a single POST on the attachment’s navigation property of todoTask; See create attachment for an example.
StartDateTime
startDateTime property on todoTask lets you set the date when tasks would be started. Now, API responses will have startDateTime when querying for users’ task.
Example: A sample for PATCH task (existing task) using app permission is like below.
Request:
{
“startDateTime”: {
“dateTime”: “2020-06-23T04:00:00.0000000”,
“timeZone”: “UTC”
}
}
Response
{
"startDateTime": {
"dateTime": "2020-06-23T04:00:00.0000000",
"timeZone": "UTC"
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#tasks/$entity",
"@odata.etag": "W/\"s8/ERWT3WEeFpBGD0bDgAA+TWq9g==\"",
"importance": "low",
"isReminderOn": false,
"status": "notStarted",
"title": "Shop for dinner",
"createdDateTime": "2020-07-22T10:39:03.7937971Z",
"lastModifiedDateTime": "2020-07-22T12:02:10.8835421Z",
"categories": [
"Important",
"Urgent"
],
"id": "721a35e2-35e2-721a-e235-1a72e2351a72",
"body": {
"content": "",
"contentType": "text"
},
"dueDateTime": {
"dateTime": "2020-08-25T04:00:00.0000000",
"timeZone": "UTC"
},
"startDateTime": {
"dateTime": "2020-06-23T04:00:00.0000000",
"timeZone": "UTC"
}
}
We cannot wait for you to try out these APIs. Thank you for continuing with us on this journey as we continue to work towards improving productivity. If you have any feedback, suggestions, or question, email us or let us know on our feedback page.
Happy coding!
0 comments