Hot questions for Using Azure in office365

Question:

I have created a simple application in Java which Connects to my Office 365 Account and retrieve the unread messages. I am performing some text matching and pattern matching to generate some reports which I receive via Email.

I am using the below url with basic Authentication to do so.

https://outlook.office365.com/api/v1.0/me/messages?$filter=IsRead%20eq%20false

However, I have read a couple of articles and most of them have suggested that Basic Authentication will not be supported and suggested to use OAUTH2.0.

I am not sure how to use OAUTH2.0. A couple of articles mention about registering the Application with AAD for which i need to have access to Azure Management Portal which i do not have. Please can any one guide me how this can be done.

PS: I am using my Corporate Domain Account to access Office


Answer:

You are correct that Basic will not continue to be supported. You do not need the Azure management portal to register an application, you can use the App Dev portal (apps.dev.microsoft.com) to get a client ID and secret.

Here's a walkthrough for creating a Java web app from scratch: https://dev.outlook.com/restapi/tutorial/java. It shows how to register the app and do the authentication.

Question:

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.


Answer:

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

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.