Reports API - POST unsubscribe from a report
Unsubscribes the specified users from the specified report.
The request consumes and produces an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/reports/{id}/unsubscribe |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/reports/{id}/unsubscribe | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/reports/{id}/unsubscribe |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | The ID of the report to unsubscribe from. | path | required |
body | ReportSubscriptions | The JSON body of the request. Contains a list of recipients to be unsubscribed. | body | optional |
Request body objects
The ReportSubscriptions
object
Configuration of a report subscription.
Element | Type | Description | Required |
---|---|---|---|
recipients | string[] | A list of the recipients. You can specify email addresses or Dynatrace user IDs here. | required |
schedule | string | The schedule of the subscription.
| 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 "recipients": [3 "demo@email.com",4 "demo2@email.com"5 ],6 "schedule": "WEEK"7}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | EntityShortRepresentation | Success. The subscriptions have been revoked. The response body contains the report ID. |
400 | ErrorEnvelope | Failed. The input is invalid. |
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
Element | Type | Description |
---|---|---|
description | string | A short description of the Dynatrace entity. |
id | string | The ID of the Dynatrace entity. |
name | string | The name of the Dynatrace entity. |
Response body JSON model
1{2 "description": "Dynatrace entity for the REST API example",3 "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",4 "name": "Dynatrace entity"5}
Example
In this example, the request updates the report from the POST request example. It removes the monthly subscriptions for the marketing.office@organization.com email address.
The API token is passed in the Authorization header.
Curl
1curl -X POST \2 https://mySampleEnv.live.dynatrace.com/api/config/v1/reports/f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73/unsubscribe \3 -H 'Accept: application/json' \4 -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \5 -H 'Content-Type: application/json' \6 -d '{7 "schedule": "MONTH",8 "recipients": [9 "marketing.office@organization.com"10 ]11 }12'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/config/v1/reports/f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73/unsubscribe
Request body
1{2 "schedule": "MONTH",3 "recipients": [4 "marketing.office@organization.com"5 ]6}
Response body
1{2 "id": "f78f78f5-00bd-4cc1-9e8b-ecfd1e379a73"3}
Response code
201