In order to successfully use this endpoint the logged in user must be a Mimecast administrator with at least the Archive | Search Logs | Read permission.
URI
To use this endpoint you send a POST request to:
/api/archive/get-search-logs
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
{
"meta": {
"pagination": {
"pageSize": Number,
"pageToken": "String"
}
},
"data": [
{
"start": "Date String",
"end": "Date String",
"query": "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
start
Date String
Optional
The earliest search log to return in the following format 2017-09-16T14:49:18+0000. Defaults to the start of the current day.
end
Date String
Optional
The latest search log to return in the following format 2017-09-16T14:49:18+0000. Defaults to the end of the current day.
Response
{
"fail": [],
"meta": {
"status": Number,
"pagination": {
"pageSize": Number,
"next": "String"
}
},
"data": [
{
"logs": [
{
"searchText": "String",
"description": "String",
"searchReason": "String",
"museQuery": "String",
"emailAddr": "String",
"source": "String",
"isAdmin": Boolean,
"searchPath": "String",
"createTime": "Date 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 array
Field
Type
Description
logs
Array
An array of search log objects.
Search Log Object
Field
Type
Description
searchText
String
The text used in the search.
description
String
The description of the search if any.
searchReason
String
The search reason entered when the search was executed if any.
museQuery
String
The Mimecast search query used if any.
emailAddr
String
The email address of the user who performed the search.
source
String
The search source context
isAdmin
Boolean
If the search was an admin search or not.
searchPath
String
The search path if any.
createTime
String
The time that the search was executed.
fail array
When a request is successful the fail array will be empty.
Field
Type
Description
errors
Array of error objects
An array of error objects describing the error returned from the API.
errors object
Field
Type
Description
message
String
The error message.
code
String
The Mimecast code associated with the error.
retryable
Boolean
If the error is retryable
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/archive/get-search-logs
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
{
"meta": {
"pagination": {
"pageSize": 25,
"pageToken": "ENTER PAGE TOKEN HERE OR REMOVE FIELD"