Skip to content

Latest commit

 

History

History
454 lines (348 loc) · 14.6 KB

File metadata and controls

454 lines (348 loc) · 14.6 KB
title Get trainingCampaign
description Read the properties and relationships of a trainingCampaign object.
author akgraph
ms.localizationpriority medium
ms.subservice security
doc_type apiPageType
ms.date 06/10/2024

Get trainingCampaign

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Read the properties and relationships of a trainingCampaign object.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

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

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]



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

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]



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

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]



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

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]



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

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]

[!INCLUDE snippet-not-available] [!INCLUDE sdk-documentation]



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"
      }
  }
}