To create GET or POST requests in the Worksection API use the following link
https://your-domain.worksection.com/api/admin/v2/?action=ACTION_NAME&
page=LINK_URL&PARAM_NAME1=PARAM_VALUE&...&PARAM_NAME_N=PARAM_VALUE&hash=HASH
- your-domain.worksection.com — address of your Worksection account, registered in the system
- action — name of the corresponding method
- page — system link to a project, task or subtask without a name of the account:
/project/PROJECT_ID/ — for projects
/project/PROJECT_ID/TASK_ID/ — for tasks
/project/PROJECT_ID/TASK_ID/SUBTASK_ID/ — for subtasks and sub-subtasks
Specified links can be obtained either directly from the browser address bar, while being on a project or task/subtask page, or composed by getting the corresponding identifiers through the following methods:
id of a task/subtask can be obtained through
get_all_tasks method
- PARAM_NAME — a number of parameter names of the corresponding method (if necessary)
- hash — verification value generated in MD5 format from three linked parameters: page, action and your API key, placed one by one without spaces in the specified order
An example of MD5 hash structure in PHP:
$hash = md5($page.$action.$apikey)
Note! In some methods, the page parameter is not required or is optional, which must be considered when forming a hash value:
$hash = md5($action.$apikey)
Response is formed in JSON format with UTF-8 encoding
The status field contains information about the request status:
- ok — request succeeded
- error — error occurred
Sample response if a request succeeded
{
"status": "ok"
}
Sample response if an error occurred
{
"status": "error",
"status_code": 2,
"message": "Action hash is missed or invalid"
}
In case of an error status, the
status_code and
message fields will contain information about the error (in some cases there will be an additional
message_details field with additional details about the error).
Correspondence between status_code / message fields:
// query errors or a verification
- 0 — Action is invalid
- 1 — Action is required
- 2 — Action hash is missed or invalid
// errors in the URL- 3 — Page is invalid
- 4 — Project is invalid
- 5 — Task is invalid
- 6 — Subtask is invalid
- 7 — Project is required
- 8 — Task is required
- 9 — Subtask is required
// other errors- 10 — Field is required, message_details contains the name of the field
- 11 — Invalid email, message_details contains invalid email
- 12 — Task is already closed
- 13 — Task has children
- 14 — Subtask is already closed
- 15 — Subtask has children
- •••
- 20 — Quota exceeded