Getting error Resource not found for the segment while using delete draft mail using Graph API

Vikas Lokhande 5 Reputation points
2024-12-02T04:42:09.3933333+00:00

HI Team,

I wanted to Delete draft once email send via graph API.

https://graph.microsoft.com/v1.0/me/messages/AAMkADM0YmZkODc0LTllNTMtNGQzNi1iMDNlLThiM2NmMmZlMzVkNgBGAAAAAACgpiXsbfqvSprR0WB4Ob1wBwCqHbPx9NBqT6xZ%2F8o1oHG5AAAAAAEPAACqHbPx9NBqT6xZ%2F8o1oHG5AAATZHY0AAA%3D

In the headers I am passing the Bearer token.

When I tried to execute this i am getting below error

{ "error": { "code": "RequestBroker--ParseUri", "message": "Resource not found for the segment '8o1oHG5AAAAAAEPAACqHbPx9NBqT6xZ'.",} }

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-12-02T05:49:44.88+00:00

    Hello Vikas Lokhande,

    Thank you for reaching out to Microsoft Support!

    After testing, the draft email will be automatically deleted when it is sent, so when we manually delete the email, there will be an error 404. You can try to GET the draft email through GET message request, if 404 appears, it means that the draft has been deleted, or you can log in to Outlook. Check in the Drafts folder.

    GET https://graph.microsoft.com/v1.0/me/messages/{id}
    

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

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