gpt4 book ai didi

rest - 访问 outlook http sync-messages 端点时出现错误 ServiceUnavailable

转载 作者:可可西里 更新时间:2023-11-01 16:36:28 26 4
gpt4 key购买 nike

我正在尝试弄清楚如何同步特定的 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 授予我访问权限(我有一个访问 token 和一个刷新 token )。

有什么想法可以实际同步这些帐户吗?看起来像是 outlook 方面的错误,因为我的代码适用于普通 outlook 帐户(如 jerry_smith@hotmail.com 或 ilovecats@outlook.com)。

提前致谢

最佳答案

找到答案了,如果你把url改成"https://outlook.office.com/api/v2.0/me/MailFolders/AllItems/messages "

(用我替换 Users/$EMAIL)

有效,没有 503。

关于rest - 访问 outlook http sync-messages 端点时出现错误 ServiceUnavailable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42282562/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com