Outlook开发中心 - OAuth Sandbox停止使用邮件。当我尝试发送时:
https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages?$top=10
我得到了:
HTTP/1.1 403 Forbidden
Transfer-Encoding: chunked
request-id: 72bb8456-b708-4395-b20b-070f59203571
X-CalculatedBETarget: AM4PR06MB1602.eurprd06.prod.outlook.com
X-BackEndHttpStatus: 403
x-ms-diagnostics: 2000008;reason="The token contains not enough scope to make this call.";error_category="invalid_grant"
OData-Version: 4.0
X-DiagInfo: AM4PR06MB1602
X-BEServer: AM4PR06MB1602
X-FEServer: AM4PR01CA0018
X-MSEdge-Ref: Ref A: C76DC482B3B948DCA89EA29991DAC69F Ref B:CFF0022456998571B7B1C5143CD90D48 Ref C: Sun Oct 30 05:12:00 2016 PST
Cache-Control: private
Date: Sun, 30 Oct 2016 12:12:00 GMT
Set-Cookie: exchangecookie=7f60ed49643e4ce098a0af5830de4eec; expires=Mon, 30-Oct-2017 12:12:00 GMT; path=/; HttpOnly
Server: Microsoft-IIS/8.5
WWW-Authenticate: Bearer client_id="00000002-0000-0ff1-ce00-000000000000", trusted_issuers="00000001-0000-0000-c000-000000000000@*", token_types="app_asserted_user_v1 service_asserted_app_v1", error="invalid_token"
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again."
}
}
经过一些调查后,我注意到OAuth Sandbox没有请求电子邮件读写权限。
这是一个错误吗?
答案 0 :(得分:1)
我不能重现这一点。假设您使用自己的帐户进行授权,Sandbox会通过Mail.ReadWrite.Shared
范围请求读/写权限。
如果您点击Authorize using Sandbox Account
,它只会请求Mail.Read.Shared
,但这足以在GET
https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages?$top=10
上Mail.ReadWrite.Shared
。{/ p>
所以回答你的问题,不,我不相信这是一个错误。 :)当您收到此错误时,您能提供更多关于您正在做什么的信息吗?您是使用Office 365帐户还是Microsoft帐户(outlook.com,Hotmail.com等)登录?
更新:问题是由Microsoft帐户不理解Mail.ReadWrite
而忽略它引起的。沙箱已更新为请求Mail.ReadWrite.Shared
和SELECT to_date('1st march 2017','dd"st" month yyyy') "Date" FROM dual;
范围。