WORKSECTION

Comments

Getting comments of tasks or subtasks through API: get_comments

Sample get_comments request

https://your—domain.com/api/admin/v2/?action=get_comments&
page=/project/PROJECT_ID/TASK_ID/SUBTASK_ID/&hash=HASH
Required parameters:
  • page — task/subtask link (see link format for details)
Optional parameters:
  • extra=files — returns information about files attached to comments

Returned data:
  • text — comment text
  • date_added — sending date and time
  • email — comment author email
  • name — comment author name and surname
  • files — information about the files attached in the comments (if the request contains corresponding extra parameter):
  • id — unique file identifier (can be used in the download method for downloading via API)
    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://your-domain.worksection.com/download/123456)

Sample JSON response
If the request succeeds, the response will contain ok status and the following data:

{
"status": "ok",
"data": [
{
"text": "USER_COMMENT_TEXT",
"date_added": "YYYY—MM—DD HH:II",
"user_from": {
"email": "USER_EMAIL",
"name": "USER_NAME"
},   "files": [   { "id": "FILE_ID",   "size": "FILE_SIZE",   "name": "Example.docx",   "page": "/download/FILE_ID"   }   ],
}
]
}

Creating comments in tasks or subtasks through API: post_comment

Sample post_comment request

https://your—domain.com/api/admin/v2/?action=post_comment&
page=/project/PROJECT_ID/TASK_ID/SUBTASK_ID/&email_user_from=USER_EMAIL&
text=TEXT&hash=HASH
This request allows comment files attaching (see How to add files)

Required parameters:
  • page — task/subtask link (see link format for details)
  • email_user_from — comment author email
  • text — comment text
Optional parameters:
  • hidden — comma separated list of user emails, who will have access to this comment, while it will be hidden for others

Sample JSON response
If the request succeeds, the response will contain ok status and url of the comment created:

{
"status": "ok",
"url": "http://your—domain.com/project/PROJECT_ID/TASK_ID/#com1764952"
}
esc
или
Print