DELETE https://graph.microsoft.com/v1.0/users/XXXX/contacts/XXX not working in Graph Explorer

Thomas Pichler Aftersales 20 Reputation points
2024-04-25T12:57:49.96+00:00

Forbidden - 403 - 268 ms. Either the signed-in user does not have sufficient privileges, or you need to consent to one of the permissions on the Modify permissions tab

Permissions are granted.

Contacts.ReadWrite

Answer:

{
    "error": {
        "code": "ErrorCannotDeleteObject",
        "message": "Object cannot be deleted."
    }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,646 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 37,216 Reputation points
    2024-04-26T02:32:10.13+00:00

    Hi @Thomas Pichler Aftersales

    It is not possible to delete another user's contacts in a delegated context, this is only available in application context.

    You should grant the Contacts.ReadWrite application permission to the calling app, then use daemon-based client credentials flow to request an access token and call that API endpoint in Postman.

    User's image

    Hope this helps.

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

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful