Problems API - PUT a comment
Updates an existing comment on the specified problem. A field omitted from the body remains unaffected.
The request consumes an application/json
payload.
PUT |
|
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
problemId | string |
The ID of the problem where you want to edit the comment. |
path | required |
commentId | string |
The ID of the comment you want to edit. |
path | required |
body | PushProblemComment |
JSON body of the request, containing the updated comment. |
body | optional |
The PushProblemComment object
A comment of a problem
Element | Type | Description | Required |
---|---|---|---|
comment | string |
A comment on the problem. |
required |
user | string |
The author of the comment. |
required |
context | string |
The context of the comment. It can contain any additional information. |
optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request. See the Example expandable section for working sample request.
{
"comment": "This is a comment!",
"user": "user1",
"context": "Slack"
}
Response format
The ProblemComment object
The comment to the problem.
Element | Type | Description |
---|---|---|
id | string | The ID of the comment. |
createdAtTimestamp | integer | The timestamp of the comment creation, in UTC milliseconds. |
content | string | The text of the comment. |
userName | string | The author of the comment. |
context | string | The context of the comment. Could be any textual comment. You can only set it via REST API. |
{
"id": "string",
"createdAtTimestamp": 0,
"content": "string",
"userName": "string",
"context": "string"
}
Example
In this example, the request updates the comment with ID -6026872125973307382_1538400720000 on the problem with ID 2307087411653364173_1538400720000V2.
The update provides additional information for context.
The API token is passed in the Authorization header.
Curl
curl -X PUT \
https://mySampleEnv.live.dexp.ae/api/v1/problem/details/2307087411653364173_1538400720000V2/comments/-6026872125973307382_1538400720000 \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"comment": "This one is probably caused by network",
"user": "john.smith",
"context": "Slack - by Tom Johnson"
}'
Request URL
https://mySampleEnv.live.dexp.ae/api/v1/problem/details/2307087411653364173_1538400720000V2/comments/-6026872125973307382_1538400720000
Request body
{
"comment": "This one is probably caused by network",
"context": "Slack - by Tom Johnson"
}
Response body
{
"id": "-6026872125973307382_1538400720000",
"createdAtTimestamp": 1538559856030,
"content": "This one is probably caused by network",
"userName": "john.smith",
"context": "Slack - by Tom Johnson"
}
Response code
200