前景 REST API 正在扼杀我吗?
Is the outlook REST API throttling me?
我创建了一个基本脚本来检查收件箱中的电子邮件,昨天一切正常。但是今天当我 运行 相同的代码时,我得到的只是一个 HTTP404。
我怀疑 outlook.office365.com 可能会限制我的请求,因为我 运行 每分钟 1 次,持续了大约 36 小时。但是我怎么知道是不是这样呢?
这是我的 curl 命令:
curl https://outlook.office365.com/api/1.0/Me/folders/Inbox/messages -u login@email.outlook:password --insecure --show-error -H Content-Type:application/json -v
和输出:
* About to connect() to outlook.office365.com port 443 (#0)
* Trying 132.245.48.18... connected
* Connected to outlook.office365.com (132.245.48.18) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
* subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=outlook.com
* start date: 2015-02-13 00:38:15 GMT
* expire date: 2016-02-13 00:38:15 GMT
* subjectAltName: outlook.office365.com matched
* issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT SSL SHA1
* SSL certificate verify ok.
* Server auth using Basic with user 'login@email.outlook'
> GET /api/1.0/Me/folders/Inbox/messages HTTP/1.1
> Authorization: Basic Ybase64stringU=
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: outlook.office365.com
> Accept: */*
> Content-Type:application/json
>
< HTTP/1.1 404 Not Found
< Content-Length: 0
< Server: Microsoft-IIS/8.0
< request-id: d7967869-c282-4a28-9da2-6b80edd7d965
< Set-Cookie: ClientId=XXQW0EIP0KK9NUIRICS8BQ; expires=Fri, 28-Oct-2016 13:04:08 GMT; path=/; secure; HttpOnly
< X-CalculatedBETarget: AM2PR09MB0452.eurprd09.prod.outlook.com
< X-BackEndHttpStatus: 404
< X-DiagInfo: AM2PR09MB0452
< X-BEServer: AM2PR09MB0452
< X-Powered-By: ASP.NET
< X-FEServer: HE1PR01CA0033
< Date: Thu, 29 Oct 2015 13:04:08 GMT
<
* Connection #0 to host outlook.office365.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
有什么想法吗?
如果您超出了配额,我希望您会收到一个 429
状态代码。 Microsoft 通常不会为其服务发布确切的阈值,因为他们保留调整它们的权利...
so users can consume the maximum number of resources without degrading the reliability and performance
(以上引用专门针对 Sharepoint,但考虑到几乎所有 REST API 都没有发布的限制,我认为该原则成立)。
404
通常会表明某些事情不太正确...如果您的用户帐户相当新,则可能表明它尚未传播到所有服务器(尽管在您的情况下还没有传播)这似乎不是问题,因为您必须拥有该帐户超过 24 小时)。
从 URL 的角度来看...v1 URL 是 outlook.office.com/api/v1.0/me/messages
而新节拍 URL 是 outlook.office.com/api/v1.0/me/messages
这些地址似乎为我工作...但如果我使用您正在使用的地址,我会收到 404...所以请仔细检查 URL.
我创建了一个基本脚本来检查收件箱中的电子邮件,昨天一切正常。但是今天当我 运行 相同的代码时,我得到的只是一个 HTTP404。
我怀疑 outlook.office365.com 可能会限制我的请求,因为我 运行 每分钟 1 次,持续了大约 36 小时。但是我怎么知道是不是这样呢?
这是我的 curl 命令:
curl https://outlook.office365.com/api/1.0/Me/folders/Inbox/messages -u login@email.outlook:password --insecure --show-error -H Content-Type:application/json -v
和输出:
* About to connect() to outlook.office365.com port 443 (#0)
* Trying 132.245.48.18... connected
* Connected to outlook.office365.com (132.245.48.18) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
* subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=outlook.com
* start date: 2015-02-13 00:38:15 GMT
* expire date: 2016-02-13 00:38:15 GMT
* subjectAltName: outlook.office365.com matched
* issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT SSL SHA1
* SSL certificate verify ok.
* Server auth using Basic with user 'login@email.outlook'
> GET /api/1.0/Me/folders/Inbox/messages HTTP/1.1
> Authorization: Basic Ybase64stringU=
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: outlook.office365.com
> Accept: */*
> Content-Type:application/json
>
< HTTP/1.1 404 Not Found
< Content-Length: 0
< Server: Microsoft-IIS/8.0
< request-id: d7967869-c282-4a28-9da2-6b80edd7d965
< Set-Cookie: ClientId=XXQW0EIP0KK9NUIRICS8BQ; expires=Fri, 28-Oct-2016 13:04:08 GMT; path=/; secure; HttpOnly
< X-CalculatedBETarget: AM2PR09MB0452.eurprd09.prod.outlook.com
< X-BackEndHttpStatus: 404
< X-DiagInfo: AM2PR09MB0452
< X-BEServer: AM2PR09MB0452
< X-Powered-By: ASP.NET
< X-FEServer: HE1PR01CA0033
< Date: Thu, 29 Oct 2015 13:04:08 GMT
<
* Connection #0 to host outlook.office365.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
有什么想法吗?
如果您超出了配额,我希望您会收到一个 429
状态代码。 Microsoft 通常不会为其服务发布确切的阈值,因为他们保留调整它们的权利...
so users can consume the maximum number of resources without degrading the reliability and performance
(以上引用专门针对 Sharepoint,但考虑到几乎所有 REST API 都没有发布的限制,我认为该原则成立)。
404
通常会表明某些事情不太正确...如果您的用户帐户相当新,则可能表明它尚未传播到所有服务器(尽管在您的情况下还没有传播)这似乎不是问题,因为您必须拥有该帐户超过 24 小时)。
从 URL 的角度来看...v1 URL 是 outlook.office.com/api/v1.0/me/messages
而新节拍 URL 是 outlook.office.com/api/v1.0/me/messages
这些地址似乎为我工作...但如果我使用您正在使用的地址,我会收到 404...所以请仔细检查 URL.