Description
Creates a new task given its properties. Requires passing in a title
and assignee
.
POST
/tasks
Required OAuth Scopes:
task:write
Parameters
Parameter | In | Type | Required | Description |
---|---|---|---|---|
body | body | Task | true | The properties of the task to create |
Body parameter example
{
"assignee": {
"id": "V1ZVd2VyFzU3NiQ1NDA4NjIzNzk2MjD"
},
"description": "Review document for spelling and grammar",
"dueDate": "2019-10-30T00:00:00Z",
"location": {
"file": "124efa2a142f472ba1ceab34ed18915f",
"fileSegment": "465ttdh2a142y75ehsft5ab34edf5675"
},
"status": "Completed",
"title": "Review Document"
}
Code Samples
curl -X POST https://api.app.wdesk.com/platform/v1/tasks \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
http POST https://api.app.wdesk.com/platform/v1/tasks \
Content-Type:application/json \
Accept:application/json \
Authorization:"Bearer {access-token}"
wget --method=POST "https://api.app.wdesk.com/platform/v1/tasks" \
--output-document - \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.app.wdesk.com/platform/v1/tasks', headers = headers)
print(r.json())
Returns
201 - Created
Returns a Task
object containing details about the newly created Task
.
Example Responses
{
"id": "129g274495354cf18edb6b3ea3d023b2",
"title": "Review Document",
"description": "Review document for spelling and grammar",
"status": "Created",
"dueDate": "2019-10-30T00:00:00Z",
"sourceUrl": "https://app.wdesk.com/tasks/d/UVdOauIzVaVkQjdxTmzNNUOEUTQOakEnTnpJTE9ENXkuEkdGeaF4OENNJEV3NUTBmA?token=NTc0NDU2MTg1MjM0ODUyTM",
"completed": {
"dateTime": "2019-10-29T15:03:27Z"
},
"modified": {
"dateTime": "2019-10-29T15:03:27Z"
},
"assignee": {
"id": "V1ZVd2VyFzU3NiQ1NDA4NjIzNzk2MjD",
"displayName": "Jane Doe",
"email": "[email protected]"
},
"created": {
"user": {
"id": "V3ZVc2VyFzV3NiQ5NDA2NjIzNxk2njH",
"displayName": "John Doe",
"email": "[email protected]"
},
"dateTime": "2019-10-28T15:03:27Z"
},
"location": {
"file": "124efa2a142f472ba1ceab34ed18915f",
"fileSegment": "465ttdh2a142y75ehsft5ab34edf5675"
}
}