我想弄清楚如何同步特定的Outlook帐户电子邮件。我正在使用http rest端点(这里是我一直关注的文档的链接:https://msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations#synchronize-messages)。
我发现,如果用户已将其现有电子邮件(暂时称为gmail)“移植”到Outlook,则Outlook会为其分配一封特殊电子邮件。通常采用以下形式:
testaccount@gmail.com - > outlook_ 一些哈希 @ outlook.com
现在,我在同步这些“移植”用户时遇到了一些问题(我现在称之为“移动”),每次点击同步api https://outlook.office.com/api/v2.0/Users/*insert email address here*/MailFolders/AllItems/messages
时,都会出现以下错误:
{ error:
{ code: 'ErrorServiceUnavailable',
message: 'Active Directory operation did not succeed. Try again later.' } }
,请求的状态代码为503
。
我的要求非常简单:
export ACCESS_TOKEN=here; export EMAIL=here; curl -X GET -H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
-H "Postman-Token: 4455c965-0d49-610a-48e8-7ab37a20c111" \
"https://outlook.office.com/api/v2.0/Users/$EMAIL/MailFolders/AllItems/messages"
响应:
< HTTP/1.1 503 Service Unavailable
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
< Server: Microsoft-IIS/8.5
< Set-Cookie: exchangecookie=**cookie**; expires=Fri, 16-Feb-2018 19:02:08 GMT; path=/; HttpOnly
< request-id: **request id**
< X-CalculatedFETarget: BN3PR0601CU001.internal.outlook.com
< X-BackEndHttpStatus: 503
< X-FEProxyInfo: BN3PR0601CA0025.NAMPRD06.PROD.OUTLOOK.COM
< X-CalculatedFETarget: namprd13-provisioning.internal.outlook.com
< X-BackEndHttpStatus: 503
< X-FEProxyInfo: DM3PR13CA0019.NAMPRD13.PROD.OUTLOOK.COM
< X-CalculatedBETarget: CY4PR13MB1078.namprd13.prod.outlook.com
< X-BackEndHttpStatus: 503
< OData-Version: 4.0
< X-AspNet-Version: 4.0.30319
< X-DiagInfo: CY4PR13MB1078
< X-BEServer: CY4PR13MB1078
< X-FEServer: DM3PR13CA0019
< X-FEServer: BN3PR0601CA0025
< X-Powered-By: ASP.NET
< X-FEServer: BY2PR11CA0016
< X-MSEdge-Ref: Ref A: 1DD7FE1BB0584157A03AB3615CBC3EB6 Ref B: BY1EDGE0414 Ref C: Thu Feb 16 11:02:08 2017 PST
< Date: Thu, 16 Feb 2017 19:02:07 GMT
<
* Curl_http_done: called premature == 0
* Connection #0 to host outlook.office.com left intact
{"error":{"code":"ErrorServiceUnavailable","message":"Active Directory operation did not succeed. Try again later."}}
此错误仅发生在这些“移植”的Outlook帐户上。这些用户通过oauth2给了我访问权限(我有访问令牌和刷新令牌)。
如何实际同步这些帐户?看起来就像outlook上的一个错误,因为我的代码适用于普通的Outlook帐户(例如jerry_smith@hotmail.com或ilovecats@outlook.com)。
提前致谢
答案 0 :(得分:1)
如果您将网址更改为,请找到答案 &#34; https://outlook.office.com/api/v2.0/me/MailFolders/AllItems/messages&#34;
(替换用户/ $ EMAIL与我)
它有效,没有503。