Get Audit Events

Pre-requisites

  • In order to successfully use this endpoint the logged in user must be a Mimecast administrator with at least the Account | Logs | Read permission.

URI

To use this endpoint you send a POST request to:

  • /api/audit/get-audit-events

Request Headers

The following request headers must be included in your request:

Field Description
Authorization Please see the Authorization guide for more information on building the Authorization header.
x-mc-req-id

A randomly generated GUID, for example,

8578FCFC-A305-4D9A-99CB-F4D5ECEFE297
x-mc-app-id The Application ID provided with your Registered API Application.
x-mc-date

The current date and time in the following format, for example,

Tue, 24 Nov 2015 12:50:11 UTC

Request Body

{
 "data": [
  {
   "query": "String", 
   "endDateTime": "String", 
   "categories": [
    "String"
   ], 
   "startDateTime": "String"
  }
 ]
}
meta
Field Type Required Description
pagination Object Optional An object defining paging options for the request.
Paginiation Object
Field Type Required Description
pageSize Number Optional The number of results to request.
pageToken String Optional The value of the 'next' or 'previous' fields from an earlier request.
data
Field Type Required Description
startDateTime Date String Required The start date in ISO 8601 date time format (e.g. 2011-12-03T10:15:30+0000). Historical lookup is restricted to last 60 days.
endDateTime Date String Required The end date in ISO 8601 date time format (e.g. 2011-12-03T10:15:30+0000).
query String Optional A character string to search for the audit events.
categories Array Optional A list of audit category types. Use values from the "code" response field from the /api/audit/get-categories endpoint. If no categories are provided, all possible categories are returned.

Response

{
 "fail": [], 
 "meta": {
  "status": 200, 
  "pagination": {
   "previous": "String", 
   "recordStart": 1, 
   "pageSize": 25, 
   "next": "String"
  }
 }, 
 "data": [
  {
   "category": "String", 
   "eventTime": "Date String", 
   "eventInfo": "String", 
   "auditType": "String", 
   "user": "String", 
   "id": "String"
  }
 ]
}
meta object
Field Type Description
status Number The function level status of the request.
pagination Object An object containing paging information.
Pagination object
Field Type Description
pageSize Number The number of results requested.
next String A pageToken value that can be used to request the next page of results. Only returned if there are more results to return.
previous String A pageToken value that can be used to request the previous page of results. Only returned if there is a previous page.
data
Field Type Description
auditType String The Mimecast audit type of the event.
category String The category of the event.
eventInfo String The detailed event information.
eventTime String The time of the event in ISO 8601 format.
id String The Mimecast unique id of the event.

Sample Code

Sample code is provided to demonstrate how to use the API and is not representative of a production application. To use the sample code; complete the required variables as described, populate the desired values in the request body, and execute in your favorite IDE.  Please see the Global Base URL's page to find the correct base URL to use for your account.

POST {base_url}/api/audit/get-audit-events
Authorization: MC {accesskKey}:{Base64 encoded signed Data To Sign}
x-mc-date: {dateTime}
x-mc-req-id: {unique id}
x-mc-app-id: {applicationId}
Content-Type: application/json
Accept: application/json


{
  "data":[
    {
        "startDateTime": "Date String",
        "endDateTime": "Date String",
        "query": "String",
        "categories": [
            "String"
        ]
    }
  ]
}
Back to Top