WORKSECTION

Comments

Getting comments of task through API: get_comments

Sample get_comments request

?action=get_comments&id_task=TASK_ID
Returns comments of selected task

Required parameters:
  • id_task — task ID
Optional parameters:
  • extra=files — attached files info

Returned data:
  • text — comment text
  • date_added — sending date and time
  • email — comment author email
  • name — comment author name and surname
  • files — attached files info (if request contains extra=files 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)

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

{
"status": "ok",
"data": [
{ "id": "COMMENT_ID", "page": "/project/PROJECT_ID/TASK_ID/SUBTASK_ID/#comCOMMENT_ID",
"text": "COMMENT_TEXT",
"date_added": "YYYY—MM—DD HH:II",
"user_from": { "id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME"
},   "files": [   { "id": "FILE_ID",   "size": "FILE_SIZE",   "name": "Example.docx",   "page": "/download/FILE_ID"   }   ],
}
]
}
Was this article helpful? Yes, thank you! No

Creating comments in task through API: post_comment

Sample post_comment request

?action=post_comment&id_task=TASK_ID&email_user_from=USER_EMAIL&text=TEXT
Creates comment in selected task
*allows files attaching (see details)

Required parameters:
  • id_task — task ID
Conditional parameters:
*at least one of parameters required: text, todo
  • text — comment text
  • todo⦋⦌ — checkbox item (combine several items to get checklist, example: todo⦋⦌=case1&todo⦋⦌=case2
Optional parameters:
  • email_user_from — comment author email (will be set automatically if using access token)
  • hidden — user emails separated by commas, who will have access to this comment, while it will be hidden for others
  • mention — user emails separated by commas, who will be mentioned at the end of the comment

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

{
"status": "ok", "data": { "id": "COMMENT_ID", "page": "/project/PROJECT_ID/TASK_ID/SUBTASK_ID/#comCOMMENT_ID", "text": "COMMENT_TEXT", "date_added": "YYYY—MM—DD HH:II", "user_from": { "id": "USER_ID", "email": "USER_EMAIL", "name": "USER_NAME" } }
}
Was this article helpful? Yes, thank you! No
esc
или
Print