HarsiddhDave
HarsiddhDave

Reputation: 91

Outlook.com REST API

I am making an UWP app somewhat like Cortanium in which i want to get the mails of the current user's account. For that i have chosen the REST API from outlook.com. But the problem is i don't know from where can i get started. I want to get the user's e-mails and then read it to the user.

I have seen the article which shows the API calls that can be made and tried but i am getting this error:

{"error":{"code":"OAuthMissingForThisAccount","message":"Authentication for this account must be using OAuth."}}

So what do i have to do in order to get a proper response ?

(P.S:I am new in the REST API world so correct me if i am wrong anywhere)

Upvotes: 3

Views: 480

Answers (1)

Grace Feng
Grace Feng

Reputation: 16652

From your error info, I think it's possible that you didn't handle the user authorization.

For every request to the Mail API, a valid access token is needed. To get this access token, you can refer to Register and authenticate your app.

In this doc:

To use the Outlook REST API to access a user's mailbox data, your app should handle registration and user authorization:

  1. First, register your app to get access to the Outlook REST API. You can then implement the API calls in your app.

  2. At runtime, get authorization from the user and make REST API requests to access the user's mailbox.

Upvotes: 1

Related Questions