javaazureoffice365-restapi

Delete user's manager in Azure through REST api


I'm able to assign user's manager through REST API using:

 PUT https://graph.windows.net/{userid}/users//$links/manager?api-version=2013-11-08

With body:

Content-Type: application/json
{
 "url": "https://graph.windows.net/contoso.onmicrosoft.com/directoryObjects/fabeb27a-0481-4a80-b43e-a5c02c125874"
}

But how can i delete user manager? please help me. Thanks in advance.


Solution

  • Please refer to the offical document references for Azure AD Graph API, as below.

    1. Other navigation properties for user navigation properties
    2. User Entity inherits from DirectoryObject

    enter image description here

    According to the above content, you can delete an user's manager via do a DELETE operation for the related directoryObject which be from the response of the operation for assignning user's manager as below.

    DELETE https://graph.windows.net/contoso.onmicrosoft.com/directoryObjects/fabeb27a-0481-4a80-b43e-a5c02c125874
    

    For more details, please see the document Delete directoryObject.