注意:同样的流程适用于 Office 365 许可证。
Exchange 设置信息:我们有一个混合环境,主要 Exchange 服务器在本地,并且在线存档用户邮箱以进行交换。
许可:Exchange Online Archiving
场景:我们正在使用Office 365 rest apis。我已使用全局管理员授权并将生成的刷新令牌存储在安全位置。使用刷新令牌,我获取访问令牌。然后使用此访问令牌获取用户的邮件端点。
然后为了获取用户的邮件文件夹,我创建了client_credentials 类型的新 access_token,然后在上述端点上查询文件夹列表。
以下是详细的请求/响应。出于隐私原因,user_name 和 access_token 已被有意删除。
** REQUEST START (Sat Apr 23 07:40:28 2016) **
REQUEST: GET https://outlook.office365.com/api/v1.0/users('<user_name>')/folders/?$top=100
Accept-Encoding: gzip, deflate
accept: application/json
User-Agent: python-requests/2.4.1 CPython/2.7.8 Linux/3.13.0-83-generic
Connection: keep-alive
content-type: application/json
Authorization: Bearer <access_token>
None
* * * *
RESPONSE (404)
x-calculatedbetarget: AM2PR05MB1089.eurprd05.prod.outlook.com
x-powered-by: ASP.NET
transfer-encoding: chunked
request-id: 8c9ac8a6-8fe7-46f6-8dcc-1fff8b1ac8ac
x-aspnet-version: 4.0.30319
server: Microsoft-IIS/8.0
cache-control: private
x-beserver: AM2PR05MB1089
x-diaginfo: AM2PR05MB1089
x-feserver: BN1PR08CA0019
set-cookie: exchangecookie=309073c961cb44798302c8eb2fee0188; expires=Sun, 23-Apr-2017 07:40:28 GMT; path=/; HttpOnly
date: Sat, 23 Apr 2016 07:40:28 GMT
odata-version: 4.0
content-type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
x-backendhttpstatus: 404
{"error":{"code":"ErrorFolderNotFound","message":"The specified folder could not be found in the store."}}
我的问题:
- 交换在线归档许可证不支持 office 365 REST API 吗?如果它们受支持,那么为什么我会收到 404 错误消息“找不到指定的文件夹”?