WorkComment

Use this resource to add and remove comments in a work instance.

Method summary

HTTP Method Path Description
POST /scr/api/WorkComment Adds and removes comments in a work instance.

POST /scr/api/WorkComment

Description
Use this method to add and remove comments in a work instance. Use the Post comment call to add comments to activities in required blueprints.
Resource information
Requirements Description
Response format JSON
Requires authentication Yes
Supports OAuth 2 client credentials Yes using a User Service ID containing Work Management Category
Rate limited Not yet
Parameters
Name Location Description Required Type
X-On-Behalf-Of Header The user context. The value must be a username in the account. The user must have permission to perform the action in the account and in the specified parent space, if any. Required if Service ID OAuth credentials are used. Not required when using User Service ID OAuth credential. String
action Query The allowed values are add and remove. Yes String
comment Query The text for the added comment. The length limit for the text is 200 characters. Yes, for an add operation String
commentId Query The ID of the removed comment. Yes, for a remove operation String
version Query The version of the requested API. The only allowed value is 20110917. Yes String
workId Query The ID of the work item that the comment is added to. Yes, for an add operation String
parentCommentId Query Indicates whether the comment is a reply to another comment. The parentCommentId must match the comment in the provided workId and must also be a top-level comment (replies to replies are not allowed). No String
Response
Example input
Add a comment asdf to the work item with a0713 ID:
  • Using User Service ID OAuth 2 client credentials with user context:
    curl -i -H "Authorization: Bearer access_token" -H "Content-Type:application/json" 
        -X POST "https://your_server_url/scr/api/WorkComment?version=20110917&action=add&workId=a0713&comment=asdf"
    
  • Using Service ID OAuth 2 client credentials with user context:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com" -H "Content-Type:application/json" 
        -X POST "https://your_server_url/scr/api/WorkComment?version=20110917&action=add&workId=a0713&comment=asdf"
    
Example output
{
    "version":"20110917",
    "action":"add",
    "commentId","234ac0"
}
Response properties
version
The version of the API used to create a response.
action
The action completed in the call.
commentId
The ID of the added or removed comment.
Response messages
HTTP code Reason
200

The request was completed successfully.

400

There was an error processing the request. Required parameters were missing or contained invalid values.

401

The user isn't authorized to make the request.

403
Access is forbidden. This message might appear for one of the following reasons:
  • The specified credentials are invalid.
  • This user doesn't have access to this work.
  • APIs aren't enabled by the administrator. APIs must be enabled on the Account Information tab.
  • The administrator didn't accept the Terms and Conditions of service.