Problems API - POST a comment
This API is deprecated. Use the Problems API v2 instead.
Adds a comments to the specified problem.
The request consumes and produces an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/problem/details/{problemId}/comments |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/problem/details/{problemId}/comments | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/problem/details/{problemId}/comments |
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
Parameter | Type | Description | In | Required |
---|---|---|---|---|
problemId | string | The ID of the problem where you want to add the comment. | path | required |
body | PushProblemComment | JSON body of the request, containing the comment. | body | optional |
Request body objects
The PushProblemComment
object
A comment of a problem
Element | Type | Description | Required |
---|---|---|---|
comment | string | A comment on the problem. | required |
context | string | The context of the comment. It can contain any additional information. | optional |
user | string | 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.
1{2 "comment": "This is a comment!",3 "context": "Slack",4 "user": "user1"5}
Response
Response codes
Code | Type | Description |
---|---|---|
200 | ProblemComment | Success |
Response body objects
The ProblemComment
object
The comment to the problem.
Element | Type | Description |
---|---|---|
content | string | The text of the comment. |
context | string | The context of the comment. Could be any textual comment. You can only set it via REST API. |
createdAtTimestamp | integer | The timestamp of the comment creation, in UTC milliseconds. |
id | string | The ID of the comment. |
userName | string | The author of the comment. |
Response body JSON model
1{2 "content": "string",3 "context": "string",4 "createdAtTimestamp": 1,5 "id": "string",6 "userName": "string"7}
Example
In this example, the request adds a new comment on the problem with ID 2307087411653364173_1538400720000V2.
The API token is passed in the Authorization header.
Curl
1curl -X POST \2 https://mySampleEnv.live.dynatrace.com/api/v1/problem/details/2307087411653364173_1538400720000V2/comments \3 -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \4 -H 'Content-Type: application/json' \5 -d '{6 "comment": "This one is probably caused by network",7 "user": "john.smith",8 "context": "Slack"9}'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/v1/problem/details/2307087411653364173_1538400720000V2/comments
Request body
1{2 "comment": "This one is probably caused by network",3 "user": "john.smith",4 "context": "Slack"5}
Response body
1{2 "id": "-6026872125973307382_1538400720000",3 "createdAtTimestamp": 1538559856030,4 "content": "This one is probably caused by network",5 "userName": "john.smith",6 "context": "Slack"7}
Response code
200