내 하늘 호스팅 웹 API는 O365 Calendar 및 Mail REST API를 사용하여 사용자를 대신하여 이벤트 및 메일을 만듭니다. 해당 Azure AD 응용 프로그램에 필요한 모든 권한이 활성화되었습니다. 내 질문 - 헤더의 일부로 Bearer OAuth 토큰을 사용하여 메일 API에 액세스 할 수 있지만 이벤트 API에 대해 동일한 토큰을 사용할 때 403과 함께 실패합니다. 내 구현을 위해 다음 문서는 공식 msdn입니다 하나 개 업데이트 - https://social.msdn.microsoft.com/Forums/exchange/en-US/6fc135ae-f8f9-4b4d-b50b-f00a2bd79a30/office-365-rest-api-mail-calendar-contacts-update?forum=exchangesvrdevelopmentOffice 365 OAuth 베어러 토큰을 사용하여 인증 할 때 HTTP-403로 이벤트 생성에 실패한 REST Calendar API
Fiddler trace (Raw view of request) -
POST https://outlook.office365.com/ews/OData/Me/Events HTTP/1.1
Accept: application/json
client-request-id: 00000000-0000-0000-0000-000000000000
Authorization: Bearer <OAuth token>
Content-Type: application/json; charset=utf-8
Host: outlook.office365.com
Content-Length: 287
Expect: 100-continue
{"Attendees":[{"EmailAddress":{"Address":"[email protected]","Name":null},"Type":"Required"}],"Body":{"Content":"Hello World","ContentType":"HTML"},"End":"2014-10-22T19:00:00Z","Location":{"DisplayName":"Conf Room M"},"Start":"2014-10-22T18:00:00Z","Subject":"Testing"}
Text view of response -
{"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."}}
Fiddler trace of the Mail API request that works fine -
POST https://outlook.office365.com/ews/OData/Me/sendmail HTTP/1.1
Accept: application/json
client-request-id: 00000000-0000-0000-0000-000000000000
Authorization: Bearer <OAuth Token>
Content-Type: application/json; charset=utf-8
Host: outlook.office365.com
Content-Length: 171
Expect: 100-continue
Connection: Keep-Alive
{"Message":{"Body":{"Content":"Test","ContentType":"HTML"},"Subject":"test","ToRecipients":[{"EmailAddress":{"Address":"[email protected]","Name":null}}]}}
무기명 토큰을 얻기 위해 사용하는 리소스 ID는 무엇입니까? –
리소스 ID - https://outlook.office365.com –