Solutions
worksection
beta
help
Getting a project task through API: get_task
Sample get_task request
?action=get_task&id_task=TASK_ID
Returns selected incomplete or completed (sub)task
*except (sub)tasks with delayed publication
*task along with its subtasks can be returned with extra=subtasks parameter
Required parameters:
- id_task — task ID
Optional parameters:
- extra — additional task info (can be specified with commas, for example extra=text,files):
- filter=active — only incomplete subtasks (when using extra=subtasks parameter)
Completed subtasks filtering is not available
text or html — description in text or html format
files — attached files info (in task description)
comments — five last comments
relations — dependencies with other tasks
subtasks — subtasks list (in child dataset)
subscribers — subscribers list
Returned data:
- id — task ID
- name — task name
- page — task link
- status — state (active/done — incomplete/completed)
- priority — priority (value range: 0..10)
- user_from and user_to — task author and task executive
- project — project info
- parent — parent task (if request contains subtask ID)
- text — task description in text or html format (if request contains corresponding extra parameter)
- date_added — creation date and time
- date_start — start date (if specified)
- date_end — due date (if specified)
- date_closed — closing date and time
- time_end — due time (if specified)
- max_time and max_money — time and financial estimates (if specified)
- tags — array in id: name format for task tags (if specified)
- files — attached files info (if request contains extra=files parameter):
- subscribers — subscribers list (if request contains extra=subscribers parameter)
- relations — dependencies with other tasks (if request contains extra=relations parameter):
- child — subtasks data (only if task ID is specified and request contains extra=subtasks parameter)
id — file ID (can be used for downloading through download method)
size — file size (in bytes)
name — file name with its extension
page — part of the link for direct download (for the full path put the address of your account in front, for example
https://youraccount.worksection.com/download/123456)
https://youraccount.worksection.com/download/123456)
from — inbound dependencies:
type — dependency type finish-to-start/start-to-start
task — linked task
to — outbound dependencies (similar to from)
Sample JSON response
If the request succeeds, the response will contain ok status and the following data:
If the request succeeds, the response will contain ok status and the following data:
*for a task
{
"status": "ok",
"data": {
"id": "TASK_ID",
"name": "TASK_NAME",
"page": "/project/PROJECT_ID/TASK_ID/",
"status": "active",
"priority": "0..10",
"user_from": {
"id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME"
},
"user_to": {
"id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME"
},
"project": {
"id": "PROJECT_ID",
"name": "PROJECT_NAME",
"page": "/project/PROJECT_ID/"
},
"text": "TASK_TEXT",
"date_added": "YYYY-MM-DD HH:II",
"date_start": "YYYY-MM-DD",
"date_end": "YYYY-MM-DD",
"date_closed": "YYYY-MM-DD HH:II",
"time_end": "HH:II",
"max_time": "25",
"max_money": "50",
"tags": {
"TAG_ID": "TAG_NAME_1",
"TAG_ID": "TAG_NAME_2"
},
"files": [
{
"id": "FILE_ID",
"size": "FILE_SIZE",
"name": "Example.docx",
"page": "/download/FILE_ID"
}
],
"subscribers": [
{
"id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME_1"
},
{
"id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME_2"
}
],
"relations": {
"to": [
{
"type": "finish-to-start",
"task": {
"id": "TASK_ID",
"name": "TASK_NAME",
"page": "/project/PROJECT_ID/TASK_ID/",
"status": "active",
"priority": "0..10"
}
}
],
"from": [
{
"type": "start-to-start",
"task": {
"id": "TASK_ID",
"name": "TASK_NAME",
"page": "/project/PROJECT_ID/TASK_ID/",
"status": "done",
"priority": "0..10"
}
}
]
},
"child": [
{
"id": "SUBTASK_ID",
"name": "SUBTASK_NAME_1",
"page": "/project/PROJECT_ID/TASK_ID/SUBTASK_ID/",
"status": "active",
"priority": "0..10",
"child": [
{
"id": "SUBTASK_ID",
"name": "SUBTASK_NAME_2",
"page": "/project/PROJECT_ID/TASK_ID/SUBTASK_ID/",
"status": "done",
"priority": "0..10"
}
]
}
]
}
}
*for a subtask/sub-subtask (identical response structure, only with additional parent dataset and without child dataset){
"status": "ok",
"data": {
"id": "SUB-SUBTASK_ID",
"name": "SUB-SUBTASK_NAME",
"page": "/project/PROJECT_ID/TASK_ID/SUB-SUBTASK_ID/",
... ... ...,
"project":
... ... ...
,
"parent": {
"id": "SUBTASK_ID",
"name": "SUBTASK_NAME",
"page": "/project/PROJECT_ID/SUBTASK_ID/",
"status": "active",
"priority": "0..10",
"parent": {
"id": "TASK_ID",
"name": "TASK_NAME",
"page": "/project/PROJECT_ID/TASK_ID/",
"status": "active",
"priority": "0..10",
}
},
"text": ...,
... ... ...
"relations":
... ... ...
}
}
Leave your review
Did this article help you?
Glad we could help! What was helpful?
Sorry this didn't help. What went wrong?