Create a resource notification in Dynatrace with the Notification Service API by providing the app, notification type, and resource identifier.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/notification/v2/resource-notifications |
You provide appId, notificationType, and resourceId in the request body. The response returns the created resource notification.
To execute this request, you need a platform token or OAuth access token with notification:notifications:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Resource | - | body | Required |
ResourceNotificationRequest object| Element | Type | Description | Required |
|---|---|---|---|
| appId | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. | Optional |
| notificationType | string | String that defines the type of a notification in context of an app. Allows to differentiate between multiple types of notifications in context of one app. | Required |
| resourceId | string | Unique identifier of resource to notify on. Used to determine if there is a notification registered for a resource in context of the app and notification type for a user. | Required |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"appId": "string","notificationType": "string","resourceId": "string"}
| Code | Type | Description |
|---|---|---|
| 201 | Resource | - |
| 4XX | Error | - |
| 5XX | Error | - |
ResourceNotification object| Element | Type | Description |
|---|---|---|
| id | string | - |
| appId | string | App id for registered notification. Optional, by default automatically inferred from the request. Only relevant for manual testing purposes via swagger. |
| notificationType | string | String that defines the type of a notification in context of an app. Allows to differentiate between multiple types of notifications in context of one app. |
| resourceId | string | Unique identifier of resource to notify on. Used to determine if there is a notification registered for a resource in context of the app and notification type for a user. |
| owningUser | string | - |
| modificationInfo | Modification | - |
ModificationInfo object| Element | Type | Description |
|---|---|---|
| createdBy | string | - |
| createdTime | string | - |
| lastModifiedBy | string | - |
| lastModifiedTime | string | - |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| message | string | - |
| code | integer | - |
| details | Error | - |
ErrorDetails object| Element | Type | Description |
|---|---|---|
| errorCode | string | - |
| errorRef | string | - |
{"id": "string","appId": "string","notificationType": "string","resourceId": "string","owningUser": "string","modificationInfo": {"createdBy": "string","createdTime": "string","lastModifiedBy": "string","lastModifiedTime": "string"}}
{"error": {"message": "string","code": 1,"details": {"errorCode": "string","errorRef": "string"}}}