List businessScenarioTasks

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.

Get a list of the businessScenarioTask objects and their properties.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) BusinessScenarioData.Read.OwnedBy, BusinessScenarioData.ReadWrite.OwnedBy
Delegated (personal Microsoft account) Not supported.
Application BusinessScenarioData.Read.OwnedBy, BusinessScenarioData.ReadWrite.OwnedBy

HTTP request

GET /solutions/businessScenarios/{businessScenarioId}/planner/tasks

Optional query parameters

This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters. You can query tasks with their context ID or location as filters.

Request headers

Name Description
Authorization Bearer {token}. Required.

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of businessScenarioTask objects in the response body.

Examples

Example 1: Get all tasks for a scenario

The following example shows a request that gets all tasks related to a scenario.

Request

The following is an example of a request.

GET https://graph.microsoft.com/beta/solutions/businessScenarios/c5d514e6c6864911ac46c720affb6e4d/planner/tasks

Response

The following is an example of the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.businessScenarioTask",
      "title": "Customer order #12010",
      "percentComplete": 0,
      "priority": 5,
      "id": "pmc1rS1Io0C3rXQhyXIsNmUAOeIi",
      "target": {
          "@odata.type": "microsoft.graph.businessScenarioGroupTarget",
          "taskTargetKind": "group",
          "groupId": "7a339254-4b2b-4410-b295-c890a16776ee"
      },
      "businessScenarioProperties": {
          "externalObjectId": "Order#12010",
          "externalContextId": "Warehouse-CA-36",
          "externalObjectVersion": "000001",
          "webUrl": "https://ordertracking.contoso.com/view?id=12010",
          "externalBucketId": "deliveryBucket"
      }
    }
  ]
}

Example 2: Get tasks associated with a specific externalContextId

The following example shows a request that gets all tasks associated with a specific context.

Request

The following is an example of a request.

GET https://graph.microsoft.com/beta/solutions/businessScenarios/c5d514e6c6864911ac46c720affb6e4d/planner/tasks?$filter=businessScenarioProperties/externalContextId eq 'Warehouse-CA-36'

Response

The following is an example of the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.businessScenarioTask",
      "title": "Customer order #12010",
      "percentComplete": 0,
      "priority": 5,
      "id": "pmc1rS1Io0C3rXQhyXIsNmUAOeIi",
      "target": {
        "@odata.type": "microsoft.graph.businessScenarioGroupTarget",
        "taskTargetKind": "group",
        "groupId": "7a339254-4b2b-4410-b295-c890a16776ee"
      },
      "businessScenarioProperties": {
        "externalObjectId": "Order#12010",
        "externalContextId": "Warehouse-CA-36",
        "externalObjectVersion": "000001",
        "webUrl": "https://ordertracking.contoso.com/view?id=12010",
        "externalBucketId": "deliveryBucket"
      }
    }
  ]
}

Example 3: Get scenario tasks created in a specific group

The following example shows a request that gets all tasks created in a specific group.

Request

The following is an example of a request.

GET https://graph.microsoft.com/beta/solutions/businessScenarios/c5d514e6c6864911ac46c720affb6e4d/planner/tasks?$filter=location/microsoft.graph.businessScenarioGroupTarget/groupId eq '7a339254-4b2b-4410-b295-c890a16776ee'

Response

The following is an example of the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.businessScenarioTask",
      "title": "Customer order #12010",
      "percentComplete": 0,
      "priority": 5,
      "id": "pmc1rS1Io0C3rXQhyXIsNmUAOeIi",
      "target": {
        "@odata.type": "microsoft.graph.businessScenarioGroupTarget",
        "taskTargetKind": "group",
        "groupId": "7a339254-4b2b-4410-b295-c890a16776ee"
      },
      "businessScenarioProperties": {
        "externalObjectId": "Order#12010",
        "externalContextId": "Warehouse-CA-36",
        "externalObjectVersion": "000001",
        "webUrl": "https://ordertracking.contoso.com/view?id=12010",
        "externalBucketId": "deliveryBucket"
      }
    }
  ]
}