This API endpoint can be used to get all user-level data for Awareness Training Mime|OS Training Campaigns. (Data displayed on Modules > Campaigns > Manage Campaign)
Pre-requisites
In order to successfully use this endpoint the logged in user must be a Mimecast administrator with at least the Awareness Training | Dashboard | Read permission.
URI
To use this endpoint you send a POST request to:
/api/awareness-training/campaign/get-user-data
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,
Search parameters used to return specific users' information. Possible values are name, email, department or customAttribute. When customAttribute is used, the attributeIds array becomes required.
attributeIds
Array of String
Optional
A list of Mimecast secure IDs for attributes to be used when searchBy is set to custom. A maximum of 3 attribute IDs can be provided.
filterBy
Array of Filter Objects
Optional
Allows filtering by specific campaign outcome by user. The fieldName should always be set to 'status' and the value should be one of sent, correct or incorrect. When no filter is applied, all results are returned.
Filter Object
Field
Type
Required
Description
fieldName
String
Required
The name of the field to search or filter based on.
value
String
Required
The value of the field to search or filter based on.
Indicates if the user has acknowledged the campaign.
email
String
The email address of the individual user.
name
String
The display name of the individual user.
department
String
The department of the individual user.
results
User Results Object
An object containing the result of each question for the user.
User Results Object
Field
Type
Description
forQuestion1
String
Result of the user's answer to question one. Possible values are correct or incorrect.
forQuestion2
String
Result of the user's answer to question two. Possible values are correct or incorrect.
forQuestion3
String
Result of the user's answer to question 3. Possible values are correct or incorrect.
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/awareness-training/campaign/get-user-data
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":[
{
"attributeIds": [
"String"
],
"searchBy": {
"value": "String",
"fieldName": "String"
},
"filterBy": [
{
"value": "String",
"fieldName": "String"
}
]
}
]
}