I'm making a web application to call Office365 REST API, and is using the authentication function of Azure AD. I am not having any progress since last week, and we suddenly got this error:
statuscode: 403,
body: '{"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."}}
Here is the request that I sent
Source code:
var request = {
url: url, method: method, json: (method === constants.GET || method === constants.DELETE) ? null : resource, headers: { 'Authorization': credentials.tokenType + ' ' + credentials.accessToken, 'User-Agent': clientId, 'Accept' : 'application/json' }
Real data:
{ url: 'https://outlook.office365.com/api/v1.0/me/folders/'AAMkADRh.....HHKAAAAAAEKAAA='/messages?%24filter=HasAttachments%20eq%20true%20and%20DateTimeSent%20ge%202014-11-13T07%3A03%3A40.924Z&%24select=Body%2CIsDeliveryReceiptRequested',
method: 'GET',
json: null,
headers:
{ Authorization: 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOi.....53W5K14rv4BzSHz43ow',
'User-Agent': '22cd7677-41ac-49f9-9147-765416532cd7',
Accept: 'application/json' } }
Could anyone explain how to fix this?