Third-party synthetic API - POST third-party events to Dynatrace
Pushes information about third-party synthetic events to Dynatrace.
The request consumes an application/json
payload.
POST |
|
Authentication
To execute this request, you need the Create and read synthetic monitors, locations, and nodes (ExternalSyntheticIntegration
) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | 3rdPartySyntheticEvents |
The JSON body of the request. Contains third-party synthetic events. |
body | optional |
Body format
The 3rdPartySyntheticEvents object
The list of third-party synthetic events.
Element | Type | Description | Required |
---|---|---|---|
syntheticEngineName | string |
The type of the third-party synthetic monitor. |
required |
open | 3rdPartyEventOpenNotification[] |
The list of open third-party synthetic events. |
optional |
resolved | 3rdPartyEventResolvedNotification[] |
The list of closed third-party synthetic events. |
optional |
The 3rdPartyEventResolvedNotification object
The closed third-party synthetic event.
Element | Type | Description | Required |
---|---|---|---|
testId | string |
The ID of the third-party synthetic monitor. |
required |
eventId | string |
The unique ID of the event. |
required |
endTimestamp | integer |
The end timestamp of the event, in UTC milliseconds. |
required |
The 3rdPartyEventOpenNotification object
The open third-party synthetic event.
Element | Type | Description | Required |
---|---|---|---|
testId | string |
The ID of the third-party synthetic monitor. |
required |
eventId | string |
The unique ID of the event. |
required |
name | string |
The name of the event. |
required |
eventType | string |
The type of the event. |
required |
reason | string |
The cause of the event. |
required |
startTimestamp | integer |
The start timestamp of the event, in UTC milliseconds. |
required |
locationIds | string[] |
The list of IDs of third-party synthetic locations where the event happens. |
required |
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.
{
"syntheticEngineName": "string",
"open": [
{
"testId": "string",
"eventId": "string",
"name": "string",
"eventType": "testOutage",
"reason": "string",
"startTimestamp": 0,
"locationIds": [
"string"
]
}
],
"resolved": [
{
"testId": "string",
"eventId": "string",
"endTimestamp": 0
}
]
}
Response
Response codes
Code | Description |
---|---|
204 | Success. The information is accepted and stored. |
400 | Failed. The input is invalid. |
Response body
A successful request doesn't return any content.
Update an existing third-party monitor
To update an existing third-party monitor, specify its engine in the syntheticEngineName field of the 3rdPartySyntheticTests
object and its ID in the id field of the 3rdPartySyntheticTest
object.
You have to submit all the parameters of the monitor. Do not change the values of parameters you don't want to change.
Example
In this example, the request adds the outage event to the example of synthetic monitor - 1 third-party synthetic monitor from the POST third-party monitors to Dynatrace example.
The API token is passed in the Authorization header.
You can download the request body JSON to perform a sample request in your environment. Be sure to replace the time stamps with recent ones or the results will be too old.
Curl
curl -X POST \
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/ext/events \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{<truncated - see the Request body section below>}
'
Request URL
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/ext/events
Request body
{
"syntheticEngineName": "My third-party synthetic",
"open": [
{
"testId": "3rdPartySyntheticMonitor1",
"eventId": "extOpenEvent1-1",
"name": "example of event",
"reason": "sample outage",
"eventType": "testOutage",
"locationIds": [
"Linz1"
],
"startTimestamp": 1543582285957
}
],
"resolved": [ ]
}
Response code
204
Result
The highlights show parameters submitted in the request.