Problems API - PUT a comment

This API is deprecated. Use the Problems API v2 instead.

Updates an existing comment on the specified problem. A field omitted from the body remains unaffected.

The request consumes an application/json payload.

PUTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v1/problem/details/{problemId}/comments/{commentId}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v1/problem/details/{problemId}/comments/{commentId}

Authentication

To execute this request, you need an access token with DataExport scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
problemIdstring

The ID of the problem where you want to edit the comment.

pathrequired
commentIdstring

The ID of the comment you want to edit.

pathrequired
bodyPushProblemComment

JSON body of the request, containing the updated comment.

bodyoptional

Request body objects

The PushProblemComment object

A comment of a problem

ElementTypeDescriptionRequired
commentstring

A comment on the problem.

required
contextstring

The context of the comment. It can contain any additional information.

optional
userstring

The author of the comment.

required

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"comment": "This is a comment!",
"context": "Slack",
"user": "user1"
}

Response

Response codes

CodeTypeDescription
200ProblemComment

Success

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Response body objects

The ProblemComment object

The comment to the problem.

ElementTypeDescription
contentstring

The text of the comment.

contextstring

The context of the comment.

Could be any textual comment. You can only set it via REST API.

createdAtTimestampinteger

The timestamp of the comment creation, in UTC milliseconds.

idstring

The ID of the comment.

userNamestring

The author of the comment.

Response body JSON model

{
"content": "string",
"context": "string",
"createdAtTimestamp": 1,
"id": "string",
"userName": "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.dynatrace.com/api/v1/problem/details/2307087411653364173_1538400720000V2/comments/-6026872125973307382_1538400720000 \
-H 'Authorization: Api-Token dt0c01.abc123.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.dynatrace.com/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