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.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/v1/synthetic/ext/events
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/synthetic/ext/events

Authentication

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

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

Parameters

Parameter
Type
Description
In
Required
body

The JSON body of the request. Contains third-party synthetic events.

body
required

Request body objects

The 3rdPartySyntheticEvents object

The list of third-party synthetic events.

Element
Type
Description
Required
open

The list of open third-party synthetic events.

optional
resolved

The list of closed third-party synthetic events.

optional
syntheticEngineName
string

The type of the third-party synthetic monitor.

required

The 3rdPartyEventOpenNotification object

The open third-party synthetic event.

Element
Type
Description
Required
eventId
string

The unique ID of the event.

required
eventType
string

The type of the event.

  • testOutage
  • testSlowdown
required
locationIds
string[]

The list of IDs of third-party synthetic locations where the event happens.

required
name
string

The name of the event.

required
reason
string

The cause of the event.

required
startTimestamp
integer

The start timestamp of the event, in UTC milliseconds.

required
testId
string

The ID of the third-party synthetic monitor.

required

The 3rdPartyEventResolvedNotification object

The closed third-party synthetic event.

Element
Type
Description
Required
endTimestamp
integer

The end timestamp of the event, in UTC milliseconds.

required
eventId
string

The unique ID of the event.

required
testId
string

The ID of the third-party synthetic monitor.

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.

{
"open": [
{
"eventId": "string",
"eventType": "testOutage",
"locationIds": [
"string"
],
"name": "string",
"reason": "string",
"startTimestamp": 1,
"testId": "string"
}
],
"resolved": [
{
"endTimestamp": 1,
"eventId": "string",
"testId": "string"
}
],
"syntheticEngineName": "string"
}

Response

Response codes

Code
Type
Description
204
-

Success. The information is accepted and stored.

400

Failed. The input is invalid.

4XX

Client side error.

5XX

Server side error.

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 timestamps 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 dt0c01.abc123.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.

External synthetic event