Warning
The official Office365APIEditor repository was archived on April 3, 2025, and all releases have been removed. The official repository points to Graph Editor as its successor application. The instructions below reflect the environment at the time of writing and are not guaranteed to work unchanged in current environments.
There is no simple way to try the Office 365 Management Activity API, but Office365APIEditor makes it relatively easy to check how it works. This article shows how to retrieve Exchange audit data. You can retrieve other audit data in a similar way.
This article is based on a procedure first published in 2019 and updated in 2022. The names and steps in the Microsoft Entra admin center and app registration pages may have changed. Microsoft Learn still documents the Office 365 Management Activity API endpoints in its reference, but check the latest official documentation when you implement or operate an integration. Unified audit logging must be enabled in your tenant before you use the API.
Note
The first content can take up to 12 hours to become available after you start a subscription. Content may also arrive in a different order from when the events occurred. See the Office 365 Management Activity API reference for details.
Try it with Office365APIEditor
Register an app and configure permissions
- Sign in to the Azure portal. In Microsoft Entra ID, open [App registrations] and select [New registration].
- Enter an app name, such as
App06. - Under [Supported account types], select [Accounts in this organizational directory only].
- Under [Redirect URI], select [Web] and enter a URI, such as
https://localhost/App06. - Select [Register], then record the [Application (client) ID].
- Select [Certificates & secrets] - [Client secrets] - [New client secret].
- Enter a description and expiration, add the secret, and record its value. Store it securely; you cannot view it again later.
- Open [API permissions], select [Add a permission] - [APIs my organization uses], and then select [Office 365 Management APIs].
- Under [Application permissions], select
ActivityFeed.ReadandActivityFeed.ReadDlp, then add the permissions. Do not add the DLP permission if you do not need access to DLP data. - Select [Grant admin consent] and confirm.
- Find your tenant ID (GUID) in the Microsoft Entra admin center. The old procedure used
Get-MsolAccountSkufrom the MSOnline module; this article no longer uses that step.
Important
Microsoft Entra page labels and permission names can change. The steps above update the portal names in the original procedure. Check the permissions required by your app and obtain admin consent. For current registration guidance, see Get started with Office 365 Management APIs.
Call the API
Install and start Office365APIEditor.
Select [Tools] - [New Editor].
Select [File] - [New Access Token].
Select [v1.0 Endpoint], then select [Next].
Select [Web app / API (Use App Only Token by client secret)], then select [Next].
Under [Tenant Name], enter your tenant’s
onmicrosoft.comdomain, such ascontoso.onmicrosoft.com.Under [Application ID], enter the Application (client) ID you recorded when registering the app.
Under [Resource], select [Office 365 Management API].
Under [Client secret], enter the secret you created in step 7, then select [Next].
In the [Request] pane, enter the following URL. Replace
<tenant-id>with the tenant ID from step 11. SelectPOSTas the method, then select [Run].1
https://manage.office.com/api/v1.0/<tenant-id>/activity/feed/subscriptions/start?contentType=Audit.Exchange
Send a
GETrequest to the following URL. Check that the subscriptionstatusisenabled.1
https://manage.office.com/api/v1.0/<tenant-id>/activity/feed/subscriptions/list
Perform an action in Exchange Online that generates an audit record.
Wait for the audit data to become available. It can take several hours.
Send a
GETrequest to the following URL. If content is available, the response includes values such ascontentUri.1
https://manage.office.com/api/v1.0/<tenant-id>/activity/feed/subscriptions/content?contentType=Audit.Exchange
Send a
GETrequest to thecontentUriin the response to retrieve the audit data.
You can capture Office365APIEditor traffic with Fiddler to inspect its API requests. If you develop an application that uses the API, you need to implement the required requests. Fiddler captures may contain access tokens and audit data. Remove sensitive information before sharing or storing a capture, and delete captures when they are no longer needed.