編輯

共用方式為


Create businessScenarioTask

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.

Create a new businessScenarioTask 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) BusinessScenarioData.ReadWrite.OwnedBy Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application BusinessScenarioData.ReadWrite.OwnedBy Not available.

HTTP request

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

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the businessScenarioTask object.

You can specify the following properties when you create a businessScenarioTask.

Property Type Description
appliedCategories plannerAppliedCategories The categories to which the task has been applied. For possible values, see plannerAppliedCategories. Inherited from plannerTask.
assigneePriority String Hint used to order items of this type in a list view. For details about the supported format, see Using order hints in Planner. Inherited from plannerTask.
assignments plannerAssignments The set of assignees the task is assigned to. Inherited from plannerTask.
bucketId String Bucket ID to which the task belongs. The bucket needs to be in the plan that the task is in. It's 28 characters long and case-sensitive. The format validation is done on the service. Inherited from plannerTask.
businessScenarioProperties businessScenarioProperties Scenario-specific properties of the task. externalObjectId and externalBucketId properties must be specified when creating a task. Required.
conversationThreadId String Thread ID of the conversation on the task. This ID references the conversation thread object created in the group. Inherited from plannerTask.
dueDateTime DateTimeOffset Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Inherited from plannerTask.
orderHint String Hint used to order items of this type in a list view. For details about the supported format, see Using order hints in Planner. Inherited from plannerTask.
percentComplete Int32 Percentage of task completion. When set to 100, the task is considered completed. Inherited from plannerTask.
planId String Identifier of the plan to which the task belongs. Inherited from plannerTask.
priority Int32 Priority of the task. Valid range of values is between 0 and 10 (inclusive), with increasing value being lower priority (0 has the highest priority and 10 has the lowest priority). Currently, Planner interprets values 0 and 1 as "urgent"; 2, 3, and 4 as "important"; 5, 6, and 7 as "medium"; and 8, 9, and 10 as "low". Currently, Planner sets the value 1 for "urgent", 3 for "important", 5 for "medium", and 9 for "low". Inherited from plannerTask.
startDateTime DateTimeOffset Date and time at which the task starts. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Inherited from plannerTask.
target businessScenarioTaskTargetBase Target of the task that specifies where the task should be placed. Required.
title String Title of the task. Inherited from plannerTask.

Response

If successful, this method returns a 201 Created response code and a businessScenarioTask object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/solutions/businessScenarios/c5d514e6c6864911ac46c720affb6e4d/planner/tasks
Content-Type: application/json

{
  "title": "Customer order #12010",
  "percentComplete": 0,
  "priority": 5,
  "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"
  }
}

Response

The following example shows the response.

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

HTTP/1.1 201 Created
Content-Type: application/json

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