WORKSECTION

Getting Started

What is the way to get access to API?

To use API in our ser­vice, you must have an API key.

AccountSecu­ri­ty → Admin API → Show API key


Note! Only the account own­er has access to the API key!


Was this article helpful? Yes, thank you! No

What are API functions in the Worksection system?

All the main fea­tures and func­tions, pre­sent­ed in the sys­tem itself, are avail­able through our API, namely:

For par­tic­i­pants and con­tacts:
  • cre­ate teams for mem­bers and fold­ers for contacts 
  • cre­ate contacts 
  • invite new account members
  • get a list of teams, mem­bers and contacts 
  • add and exclude project members
  • sub­scribe and unsub­scribe task members

For tasks and com­ments:
  • cre­ate, edit, close and reopen tasks
  • get task data 
  • get a list of: 
  • all tasks
  • tasks of a spe­cif­ic project 
  • tasks accord­ing to search parameters 
  • post and get task comments
  • cre­ate, set and remove task statuses/​labels

For projects:
  • cre­ate, edit, archive and acti­vate projects 
  • cre­ate folders 
  • get project data 
  • get a list of projects and folders 
  • cre­ate, set and remove project statuses/​tags

For entered costs and enabled timers:
  • cre­ate, update and delete time and finan­cial costs 
  • get par­tic­u­lar cost rows and total costs for projects and indi­vid­ual tasks 
  • get a list of enabled mem­ber timers 
  • stop enabled mem­ber timers 

For files:
  • the abil­i­ty to attach files to com­ments and project/​task descrip­tions dur­ing cre­ation as well as to get uploaded and attached files

Note! To pre­vent the loss, acci­den­tal dele­tion or inten­tion­al destruc­tion of cru­cial data, the abil­i­ty to delete most of the data was exclud­ed, namely:
  • projects/​tasks/​comments
  • account members/​contacts
  • project/​task statuses/​labels
  • uploaded and attached files
Was this article helpful? Yes, thank you! No

Main principles of API-based work

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
    id of a project can be obtained through get_projects 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


Was this article helpful? Yes, thank you! No
esc
или
Print