Note: Same flow is working for Office 365 license.
Exchange Setup information: We have a hybrid environment, with primary exchange server being on-premise and are archiving user mails boxes in exchange online.
Licensing: Exchange Online Archiving
Scenario: We are using Office 365 rest apis. I have used Global admin authorization and stored the resulting refresh token in secure location. Using refresh token, I fetch access token. This access token is then used to fetch User's Mail endpoint.
Then to fetch users mail folder, I create new access_token of client_credentials type and then query for folder listing on the above endpoint.
Below is the detailed request/response. user_name and access_token has been intentionally removed for privacy reasons.
** 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."}}
My question:
- Are office 365 rest APIs not supported for exchange online archiving license? If they are supported, then why I am getting 404 error with message "specified folder not found"?
