Share via

Cannot update a ToDo item using MsGraph

David Craggs 0 Reputation points
2024-07-17T15:40:37.7666667+00:00

I am trying to update a ToDo item using MsGraph.

I can create one using this URL

'me/todo/lists/TASKLISTID==/tasks

Json sent is

{"title":"Test new","dueDateTime":{"dateTime":"2024-07-17T00:00:00.000Z","timeZone":"UTC"}}

Works fine

But updating using this url with the same json fails

me/todo/lists/TASKLISTID/tasks/TASKID

Fails with a 404 and this message

{"error":{"code":"UnknownError","message":"","innerError":{"date":"2024-07-17T14:33:22","request-id":"a82fbb85-aac4-4988-b350-131d57a5c92e","client-request-id":"a82fbb85-aac4-4988-b350-131d57a5c92e"}}}

TASKID is correct

Note TASLKLISTID and TASKID are replaced with real values.

Getting the same result when I try it in MS Graph Explorer

Any ideas?

Dave Craggs

BTW - ChatGPT took me through all the obvious stuff!

Microsoft Security | Microsoft Graph
0 comments No comments

2 answers

Sort by: Most helpful
  1. David Craggs 0 Reputation points
    2024-07-18T13:57:40.85+00:00

    Changed the forward slash to a ? before the task ID and it worked

    Sorry - No it didn't.

    Was this answer helpful?


  2. Michael Taylor 61,226 Reputation points
    2024-07-17T15:46:00.63+00:00

    Please post the actual HTTP request you're sending. Creating a task uses POST and a formal task definition. An update is a PATCH and requires only the fields you're changing. Given a 404 you're either using the wrong IDs or the wrong verb I'd wager. Posting the actual HTTP requests would help clarify that. Refer to the docs for an example request for update and try to see if that works for your new task.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.