Get trainingCampaign
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Read the properties and relationships of a trainingCampaign object.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ❌ | ❌ | ❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | AttackSimulation.Read.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | AttackSimulation.Read.All | Not available. |
HTTP request
GET /security/attackSimulation/trainingCampaigns/{trainingCampaignId}
Optional query parameters
This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a trainingCampaign object in the response body.
Examples
Example 1: Get a training campaign
The following example shows how to get an attack simulation campaign for a tenant.
Request
GET https://graph.microsoft.com/beta/security/attackSimulation/trainingCampaigns/f1b13829-3829-f1b1-2938-b1f12938b1a
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "81c59451-2929-5b39-86f0-5a2b15f1314f",
"displayName": "graph toc update 2",
"description": "Graph Test",
"createdDateTime": "2024-02-18T08:36:07.6534871Z",
"lastModifiedDateTime": "2024-02-19T08:00:01.9417887Z",
"endUserNotificationSetting": null,
"includedAccountTarget": null,
"excludedAccountTarget": null,
"trainingSetting": null,
"report": null,
"campaignSchedule": {
"launchDateTime": "2024-02-18T08:37:44Z",
"completionDateTime": "2024-02-19T07:59:44Z",
"status": "completed"
},
"createdBy": {
"email": "attacksim@a830edad9050849EQTPWBJZXODQ.onmicrosoft.com",
"id": "478a22cd-aecc-41df-b995-88c8de17aaf5",
"displayName": "attacksim"
},
"lastModifiedBy": {
"email": "attacksim@a830edad9050849EQTPWBJZXODQ.onmicrosoft.com",
"id": "478a22cd-aecc-41df-b995-88c8de17aaf5",
"displayName": "attacksim"
}
}
Example 2: Get included account targets
The following example shows how to get included account targets (users) for a Training campaign for a tenant.
Request
GET https://graph.microsoft.com/beta/security/attackSimulation/trainingCampaigns/f1b13829-3829-f1b1-2938-b1f12938b1a/includedAccountTarget
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
"type": "addressBook",
"accountTargetEmails": [
"john@contoso.com"
]
}
Example 3: Get excluded account targets
The following example shows how to get the excluded account targets (users) for a Training campaign for a tenant.
Request
GET https://graph.microsoft.com/beta/security/attackSimulation/trainingCampaigns/f1b13829-3829-f1b1-2938-b1f12938b1a/excludedAccountTarget
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.addressBookAccountTargetContent",
"type": "addressBook",
"accountTargetEmails": [
"alie@contoso.com"
]
}
Example 4: Get training setting
The following example shows how to get training setting details for a training campaign.
Request
GET https://graph.microsoft.com/beta/security/attackSimulation/trainingCampaigns/f1b13829-3829-f1b1-2938-b1f12938b1a/trainingSetting
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"trainingCompletionDuration": "0",
"completionDateTime": "2024-02-19T07:59:44Z",
"settingType": "microsoftManaged"
}
Example 5: Get end user notification setting
The following example shows how to get end user notification setting details for a training campaign.
Request
GET https://graph.microsoft.com/beta/security/attackSimulation/trainingCampaigns/f1b13829-3829-f1b1-2938-b1f12938b1a/endUserNotificationSetting
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"settingType": "trainingSelected",
"positiveReinforcement": null,
"notificationPreference": "microsoft",
"trainingAssignment" : {
"deliveryFrequency": "unknown",
"defaultLanguage": "en",
"endUserNotification": {
"id": "36fb4dc1-7c37-4b96-9096-12e6d6014fae",
"displayName": "Microsoft default training only campaign-training assignment notification"
}
},
"trainingReminder" : {
"deliveryFrequency": "weekly",
"defaultLanguage": "en",
"endUserNotification": {
"id": "fe521249-9901-4584-a987-026a9980c58e",
"displayName": "Microsoft default training only campaign-training reminder notification"
}
}
}