Skip to main content

Office 365 Management API Data Source

The Office 365 Management API connector enables you to retrieve audit log subscriptions, start subscriptions for specific content types, and fetch audit log content for compliance and security monitoring. This connector is particularly useful for applications that need to extract audit logs, monitor Office 365 activity, analyze security events, or integrate compliance data with SIEM and security systems. Follow the instructions below to create a new data flow that ingests data from an Office 365 Management API source in Nexla.
office_365_management_api.png

Office 365 Management API

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Office 365 Management API connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Office 365 Management API, and click Next; or, create a new Office 365 Management API credential for use in this flow.

  3. In Nexla, Office 365 Management API data sources can be created using pre-built endpoint templates, which expedite source setup for common Office 365 Management API endpoints. Each template is designed specifically for the corresponding Office 365 Management API endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Office 365 Management API sources can also be configured manually, allowing you to ingest data from Office 365 Management API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Office 365 Management API endpoints. Each template is designed specifically for the corresponding Office 365 Management API endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    List Active Subscriptions

    This endpoint retrieves a list of current audit log subscriptions for the tenant. Use this endpoint when you need to check which content types are currently being monitored, verify subscription status, or list active subscriptions.

    • This endpoint automatically retrieves all active subscriptions for your Office 365 tenant. No additional configuration is required beyond selecting this endpoint template.

    The List Active Subscriptions endpoint uses GET requests to retrieve subscription information from the Office 365 Management API. The endpoint returns information about active subscriptions including content types and subscription status. For more information about the List Active Subscriptions endpoint, refer to the Office 365 Management API Documentation.

    Start Subscription

    This endpoint starts monitoring a specific audit log content type. This must be done before retrieving content for that type. Use this endpoint when you need to enable monitoring for a specific content type, activate audit log subscriptions, or start collecting audit data.

    • Enter the content type to monitor in the CONTENT_TYPE field. Common content types include Audit.AzureActiveDirectory, Audit.Exchange, Audit.SharePoint, Audit.General, and DLP.All. Refer to the Office 365 Management API documentation for the complete list of available content types.

    The Start Subscription endpoint uses POST requests to activate monitoring for a specific content type. After starting a subscription, Office 365 will begin generating content blobs for that content type, which can then be retrieved using the Fetch Audit Log Content endpoint. For more information about the Start Subscription endpoint, refer to the Office 365 Management API Documentation.

    Fetch Audit Log Content

    This endpoint retrieves audit log records for a specific content type and time range. It first finds the relevant content blob URLs and then downloads and outputs the JSON records contained within those blobs. Use this endpoint when you need to extract audit logs, analyze security events, or retrieve compliance data.

    • Enter the content type to retrieve in the CONTENT_TYPE_LOC field. This should match a content type that has been started using the Start Subscription endpoint. Common content types include Audit.AzureActiveDirectory, Audit.Exchange, Audit.SharePoint, Audit.General, and DLP.All.
    • Enter the start time for the audit log retrieval in ISO 8601 format (e.g., 2024-01-01T00:00:00Z) in the START_TIME field. This specifies the beginning of the time range for retrieving audit log content.
    • Enter the end time for the audit log retrieval in ISO 8601 format (e.g., 2024-01-31T23:59:59Z) in the END_TIME field. This specifies the end of the time range for retrieving audit log content.

    The Fetch Audit Log Content endpoint uses a two-step process: first retrieving content blob URLs, then downloading and parsing the JSON records from those blobs. The endpoint supports pagination through NextPageUri and automatically handles both steps. For more information about the Fetch Audit Log Content endpoint, refer to the Office 365 Management API Documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Office 365 Management API data sources can be manually configured to ingest data from any valid Office 365 Management API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Office 365 Management API sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Office 365 Management API from the Method pulldown menu. The most common methods are:

    • GET: For retrieving data from the API (most Office 365 Management API endpoints use GET)
    • POST: For starting or stopping subscriptions

API Endpoint URL

  1. Enter the URL of the Office 365 Management API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters. Office 365 Management API endpoints typically follow the pattern https://manage.office.com/api/v1.0/{tenant_id}/activity/feed/{resource}, where {tenant_id} is your tenant ID.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint URL should use your tenant ID configured in the credential. Office 365 Management API requires OAuth 2.0 authentication with the ActivityFeed.Read permission.

Path to Data

Optional

If only a subset of the data that will be returned by API endpoint is needed, you can designate the part(s) of the response that should be included in the Nexset(s) produced from this source by specifying the path to the relevant data within the response. This is particularly useful when API responses contain metadata, pagination information, or other data that you don't need for your analysis.

For example, when a request call is used to fetch audit log content, the API will typically return audit log records along with metadata. By entering the path to the relevant data, you can configure Nexla to extract the specific audit log records you need.

Path to Data is essential when API responses have nested structures. Without specifying the correct path, Nexla might not be able to properly parse and organize your data into usable records. For Office 365 Management API responses, common paths include $ for the entire response, $[*] for arrays of records, or $[0] for the first element in an array.

  • To specify which data should be treated as relevant in responses from this source, enter the path to the relevant data in the Set Path to Data in Response field.

    • For responses in JSON format enter the JSON path that points to the object or array that should be treated as relevant data. JSON paths use dot notation (e.g., $[*] to access all elements in an array).
    Path to Data Example:

    If the API response is in JSON format and includes an array of audit log records, the path to the response would be entered as $[*] to extract all records.

Autogenerate Path Suggestions

Nexla can also autogenerate data path suggestions based on the response from the API endpoint. These suggested paths can be used as-is or modified to exactly suit your needs.

  • To use this feature, click the Test button next to the Set API URL field to fetch a sample response from the API endpoint. Suggested data paths generated based on the content & format of the response will be displayed in the Suggestions box below the Set Path to Data in Response field.

  • Click on a suggestion to automatically populate the Set Path to Data in Response field with the corresponding path. The populated path can be modified directly within the field if further customization is needed.

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this source, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (e.g., header1:value1,header2:value2). Additional headers are often required for API versioning, content type specifications, or custom authentication requirements.

    You do not need to include any headers already present in the credentials. Common headers like Authorization, Content-Type, and Accept are typically handled automatically by Nexla based on your credential configuration. For Office 365 Management API, the Authorization header with Bearer token is automatically included from your credential, and Content-Type is typically set to application/json;charset=UTF-8 for POST requests.

Endpoint Testing

After configuring all settings for the selected endpoint, Nexla can retrieve a sample of the data that will be fetched according to the current configuration. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Save & Activate the Source

  1. Once all of the relevant steps in the above sections have been completed, click the Create button in the upper right corner of the screen to save and create the new Office 365 Management API data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.