Comments

Comments API Calls

Used to get and post new comments for a selected task (eventually files and tickets). Type value must be set to "task" for now. Type ID must be set to a valid task id.

Get Comments

GET /{type}/{type_id}/comments (Returns all comments associated with the type ID)
GET /{type}/{type_id}/comments/{comment_id} (Returns a specific comment based on the type and type ID value)

Response

When successful a 200 OK status will be returned. 
{
   "_links":{
      "self":{
         "href":"https://api.projecturf.com/tasks/51207550/comments?page=1"
      },
      "first":{
         "href":"https://api.projecturf.com/tasks/51207550/comments"
      },
      "last":{
         "href":"https://api.projecturf.com/tasks/51207550/comments?page=1"
      }
   },
   "_embedded":{
      "comments":[
         {
            "id":"68604042",
            "author_id":"1604741",
            "author":"Samuel Parker",
            "comment":"Test project comment",
            "attachments":null,
            "posted":"2015-02-18 16:26:07",
            "_links":{
               "self":{
                  "href":"https://api.projecturf.com/tasks/51207550/comments/68604042"
} } }, { "id":"68604026", "author_id":"2684141", "author":"Jackie Wheel", "comment":"More testing for the test project.", "attachments":null, "posted":"2015-04-05 05:45:32", "_links":{ "self":{ "href":"https://api.projecturf.com/tasks/51207550/comments/68604026"
} } } ] }, "page_count":1, "page_size":25, "total_items":2 }


Create Comment

Add a new comment to an existing type.

POST /{type}/{type_id}/comments

Parameter

Required

Description

comment

Required

Text of new comment being added.

Response

When successful a 201 Created status along with the new comment ID will be returned.  The new comment location is also returned in the response header.
{
   "id":"68644036",
"_links":{ "self":{ "href":"https://api.projecturf.com/tasks/51207550/comments/68644036"
} } }


Delete Comment

Delete a comment from the system.

DELETE /{type}/{type_id}/comments/{comment_id}

Parameter

Description

restore

Optional parameter. 0 = delete (default), 1 = restore

Response

When successful a 204 No Content status will be returned.


Feedback and Knowledge Base