Online Docs

Create task

Create a new task in the current channel that user is in. All the inputted fields will be posted.

1
2
3
4
5
POST /odata/tasks
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]
--data-raw: {Task-Object}

URL Endpoint

odata/tasks.

Method

POST

Parameters

No Support OData Filter syntax.

Request

Header

1
2
3
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]

Body

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"source": "Microsoft.Vsts",
"name": "VSTS",
"owner": "Cora Rowland",
"priority": "Normal",
"status": "Not Started",
"body": "",
"startDate": "2020-03-05T00:00:00Z",
"dueDate": "2020-04-06T00:00:00Z",
"effort": "",
"phase": "Anadea\\Sprint 1",
"phaseName": "Anadea\\Sprint 1",
"bucket": null,
"bucketName": null,
"projectId": "5f486bac2267befa2bb93814",
"assignedTo": [
{
"displayName": "Oliver Neal",
"email": "oliver@anadea.com",
"source": "Microsoft.Graph.User",
"sourceId": "5083cb81-35f4-4abd-ba2d-e7b9965c1f89",
"username": "oliver@anadea.com",
"_id": "5e12cac785c88e43cb38bbaf"
}
],
"attachments": [],
"completedDate": null
}

Response

Success

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

Error
Code: 400 Bad Request, 401 Unauthorized, 500 Error Exception.
Content: { error : “error message” }

Example

Request

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
curl --location --request POST 'https://teams.appvity.com/odata/tasks' \
--header 'x-appvity-channelId: 19:15c258785b4040699180e7a8ad6c6014@thread.tacv2' \
--header 'x-appvity-teamid: 19:15c258785b4040699180e7a8ad6c6014@thread.tacv2' \
--header 'Cookie: graphNodeCookie=s%3AlaIrRjrQdBULLxHHgBM0ofupyqfGBmRf.4vy0SDHjNaJ9%2Fa3MeJbeIOQchnkP1NNAQTv9AViLawk' \
--data-binary '
{
"source": "Microsoft.Vsts",
"name": "VSTS",
"owner": "Cora Rowland",
"priority": "Normal",
"status": "Not Started",
"body": "",
"startDate": "2020-03-05T00:00:00Z",
"dueDate": "2020-04-06T00:00:00Z",
"effort": "",
"phase":"Anadea\\Sprint 1",
"phaseName":"Anadea\\Sprint 1",
"bucket": null,
"bucketName": null,
"projectId": "5f486bac2267befa2bb93814",
"assignedTo": [
{
"displayName": "Oliver Neal",
"email": "oliver@anadea.com",
"source": "Microsoft.Graph.User",
"sourceId": "5083cb81-35f4-4abd-ba2d-e7b9965c1f89",
"username": "oliver@anadea.com",
"_id": "5e12cac785c88e43cb38bbaf"
}
],
"attachments": [],
"completedDate": null
}
' \

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
"source": "Microsoft.Vsts",
"name": "VSTS",
"owner": "Cora Rowland",
"priority": "Normal",
"status": "Not Started",
"body": "",
"startDate": "2020-03-05T00:00:00Z",
"dueDate": "2020-04-06T00:00:00Z",
"effort": "",
"phase":"Anadea\\Sprint 1",
"phaseName":"Anadea\\Sprint 1",
"bucket": null,
"bucketName": null,
"projectId": "5f486bac2267befa2bb93814",
"assignedTo": [
{
"displayName": "Oliver Neal",
"email": "oliver@anadea",
"source": "Microsoft.Graph.User",
"sourceId": "5083cb81-35f4-4abd-ba2d-e7b9965c1f89",
"username": "oliver@anadea.com",
"_id": "5e12cac785c88e43cb38bbaf"
}
],
"attachments": [],
"completedDate": null

Comment

Was this article helpful?
Thanks For Your Feedback