Post Task Comment

Creates a comment for a task by id.

Method

POST /task/{id}/comment/create

Parameters

Path Parameters

Name Description
id The id of the task to add the comment to.

Request Body

A JSON object with the following properties:

Name Description
message The message of the task comment to create. Has to be of type String.

Result

A JSON object representing the newly created comment. Its structure corresponds to the Comment interface in the engine. Its properties are as follows:

Name Value Description
id String The id of the task comment.
userId String The id of the user who created the comment.
taskId String The id of the task to which the comment belongs.
time Date The time when the comment was created.
message String The content of the comment.
links List Link to the newly created task comment with method, href and rel.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json The task does not exist or no comment message was submitted. See the Introduction for the error response format.
403 application/json The history of the engine is disabled. See the Introduction for the error response format.

Example

Request

Post data for a new task comment:

POST /task/aTaskId/comment/create

{"message": "a task comment"}

Response

Status 200.

{
  "links": [
    {
      "method": "GET",
      "href": "http://localhost:38080/rest-test/task/aTaskId/comment/aTaskCommentId",
      "rel": "self"
    }
  ],
  "id": "aTaskCommentId",
  "userId": "userId",
  "taskId": "aTaskId",
  "time": "2013-01-02T21:37:03",
  "message": "comment message"
}

On this Page: