Synthetics

La monitorización Synthetic Datadog utiliza solicitudes de usuario simuladas y la renderización del navegador para ayudarte a garantizar el tiempo de actividad, identificar problemas regionales y realizar un seguimiento del rendimiento de tu aplicación. Los tests Synthetics vienen en dos formatos diferentes, [tests de API]((https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) y tests de navegador. Puedes utilizar la API Datadog para gestionar ambos tipos de tests mediante programación.

Para obtener más información, consulta la documentación de la monitorización Synthetic.

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/apihttps://api.datadoghq.eu/api/v1/synthetics/tests/apihttps://api.ddog-gov.com/api/v1/synthetics/tests/apihttps://api.datadoghq.com/api/v1/synthetics/tests/apihttps://api.us3.datadoghq.com/api/v1/synthetics/tests/apihttps://api.us5.datadoghq.com/api/v1/synthetics/tests/api

Información general

Crea un test de API Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles del test a crear.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic API test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

steps

[ <oneOf>]

When the test subtype is multi, the steps of the test.

Option 1

object

The Test step used in a Synthetic multi-step API test.

allowFailure

boolean

Determines whether or not to continue with test if this step fails.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

exitIfSucceed

boolean

Determines whether or not to exit the test if the step succeeds.

extractedValues

[object]

Array of values to parse and save as variables from the response.

field

string

When type is http_header or grpc_metadata, name of the header or metadatum to extract.

name

string

Name of the variable to extract.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

secure

boolean

Determines whether or not the extracted value will be obfuscated.

type

enum

Property of the Synthetic Test Response to extract into a local variable. Allowed enum values: grpc_message,grpc_metadata,http_body,http_header,http_status_code

extractedValuesFromScript

string

Generate variables using JavaScript.

isCritical

boolean

Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allowFailure is true.

name [required]

string

The name of the step.

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

subtype [required]

enum

The subtype of the Synthetic multi-step API test step. Allowed enum values: http,grpc

Option 2

object

The Wait step used in a Synthetic multi-step API test.

name [required]

string

The name of the step.

subtype [required]

enum

The subtype of the Synthetic multi-step API wait step. Allowed enum values: wait

value [required]

int32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

variablesFromScript

string

Variables defined from JavaScript code.

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID for the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, api. Allowed enum values: api

default: api

{
  "config": {
    "steps": [
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "password": "password",
            "username": "username"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "password": "password",
            "username": "username",
            "type": "web"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "accessKey": "accessKey",
            "secretKey": "secretKey",
            "type": "sigv4"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "type": "ntlm"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "password": "password",
            "username": "username",
            "type": "digest"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "accessTokenUrl": "accessTokenUrl",
            "tokenApiAuthentication": "header",
            "clientId": "clientId",
            "clientSecret": "clientSecret",
            "type": "oauth-client"
          }
        },
        "subtype": "http"
      },
      {
        "assertions": [
          {
            "operator": "is",
            "type": "statusCode",
            "target": 200
          }
        ],
        "name": "request is sent",
        "request": {
          "url": "https://httpbin.org/status/200",
          "method": "GET",
          "basicAuth": {
            "accessTokenUrl": "accessTokenUrl",
            "password": "password",
            "tokenApiAuthentication": "header",
            "username": "username",
            "type": "oauth-rop"
          }
        },
        "subtype": "http"
      }
    ]
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json",
  "name": "Example-Synthetic",
  "options": {
    "tick_every": 60
  },
  "subtype": "multi",
  "type": "api"
}
{
  "config": {
    "assertions": [
      {
        "operator": "is",
        "target": 1,
        "type": "grpcHealthcheckStatus"
      },
      {
        "operator": "is",
        "target": "proto target",
        "type": "grpcProto"
      },
      {
        "operator": "is",
        "target": "123",
        "property": "property",
        "type": "grpcMetadata"
      }
    ],
    "request": {
      "host": "localhost",
      "port": 50051,
      "service": "Hello",
      "method": "GET",
      "message": "",
      "metadata": {}
    }
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "BDD test payload: synthetics_api_grpc_test_payload.json",
  "name": "Example-Synthetic",
  "options": {
    "min_failure_duration": 0,
    "min_location_failed": 1,
    "monitor_options": {
      "renotify_interval": 0
    },
    "monitor_name": "Example-Synthetic",
    "tick_every": 60
  },
  "subtype": "grpc",
  "tags": [
    "testing:api"
  ],
  "type": "api"
}
{
  "config": {
    "assertions": [
      {
        "operator": "is",
        "property": "{{ PROPERTY }}",
        "target": "text/html",
        "type": "header"
      },
      {
        "operator": "lessThan",
        "target": 2000,
        "type": "responseTime",
        "timingsScope": "withoutDNS"
      },
      {
        "operator": "validatesJSONPath",
        "target": {
          "jsonPath": "topKey",
          "operator": "isNot",
          "targetValue": "0"
        },
        "type": "body"
      },
      {
        "operator": "validatesJSONPath",
        "target": {
          "elementsOperator": "atLeastOneElementMatches",
          "jsonPath": "topKey",
          "operator": "isNot",
          "targetValue": "0"
        },
        "type": "body"
      },
      {
        "operator": "validatesJSONSchema",
        "target": {
          "metaSchema": "draft-07",
          "jsonSchema": "{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}"
        },
        "type": "body"
      },
      {
        "operator": "validatesXPath",
        "target": {
          "xPath": "target-xpath",
          "targetValue": "0",
          "operator": "contains"
        },
        "type": "body"
      },
      {
        "operator": "md5",
        "target": "a",
        "type": "bodyHash"
      },
      {
        "code": "const hello = 'world';",
        "type": "javascript"
      }
    ],
    "configVariables": [
      {
        "example": "content-type",
        "name": "PROPERTY",
        "pattern": "content-type",
        "type": "text"
      }
    ],
    "variablesFromScript": "dd.variable.set(\"FOO\", \"foo\")",
    "request": {
      "certificate": {
        "cert": {
          "content": "cert-content",
          "filename": "cert-filename",
          "updatedAt": "2020-10-16T09:23:24.857Z"
        },
        "key": {
          "content": "key-content",
          "filename": "key-filename",
          "updatedAt": "2020-10-16T09:23:24.857Z"
        }
      },
      "headers": {
        "unique": "examplesynthetic"
      },
      "method": "GET",
      "timeout": 10,
      "url": "https://datadoghq.com",
      "proxy": {
        "url": "https://datadoghq.com",
        "headers": {}
      },
      "basicAuth": {
        "accessTokenUrl": "https://datadog-token.com",
        "audience": "audience",
        "clientId": "client-id",
        "clientSecret": "client-secret",
        "resource": "resource",
        "scope": "yoyo",
        "tokenApiAuthentication": "header",
        "type": "oauth-client"
      },
      "persistCookies": true
    }
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "BDD test payload: synthetics_api_http_test_payload.json",
  "name": "Example-Synthetic",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": true,
    "follow_redirects": true,
    "min_failure_duration": 10,
    "min_location_failed": 1,
    "monitor_name": "Example-Synthetic",
    "monitor_priority": 5,
    "retry": {
      "count": 3,
      "interval": 10
    },
    "tick_every": 60,
    "httpVersion": "http2"
  },
  "subtype": "http",
  "tags": [
    "testing:api"
  ],
  "type": "api"
}

Respuesta

OK - Returns the created test details.

Object containing details about a Synthetic API test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic API test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

steps

[ <oneOf>]

When the test subtype is multi, the steps of the test.

Option 1

object

The Test step used in a Synthetic multi-step API test.

allowFailure

boolean

Determines whether or not to continue with test if this step fails.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

exitIfSucceed

boolean

Determines whether or not to exit the test if the step succeeds.

extractedValues

[object]

Array of values to parse and save as variables from the response.

field

string

When type is http_header or grpc_metadata, name of the header or metadatum to extract.

name

string

Name of the variable to extract.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

secure

boolean

Determines whether or not the extracted value will be obfuscated.

type

enum

Property of the Synthetic Test Response to extract into a local variable. Allowed enum values: grpc_message,grpc_metadata,http_body,http_header,http_status_code

extractedValuesFromScript

string

Generate variables using JavaScript.

isCritical

boolean

Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allowFailure is true.

name [required]

string

The name of the step.

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

subtype [required]

enum

The subtype of the Synthetic multi-step API test step. Allowed enum values: http,grpc

Option 2

object

The Wait step used in a Synthetic multi-step API test.

name [required]

string

The name of the step.

subtype [required]

enum

The subtype of the Synthetic multi-step API wait step. Allowed enum values: wait

value [required]

int32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

variablesFromScript

string

Variables defined from JavaScript code.

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID for the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, api. Allowed enum values: api

default: api

{
  "config": {
    "assertions": [
      []
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "steps": [],
    "variablesFromScript": "dd.variable.set(\"FOO\", \"foo\")"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "subtype": "http",
  "tags": [
    "env:production"
  ],
  "type": "api"
}

- JSON format is wrong - Creation failed

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Test quota is reached

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          ## Create an API test.
# Example of an API test.

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [ { "operator": "lessThan", "target": 1000, "type": "responseTime" }, { "operator": "is", "target": 200, "type": "statusCode" }, { "operator": "is", "property": "content-type", "target": "text/html; charset=UTF-8", "type": "header" } ], "request": { "method": "GET", "url": "https://example.com" } }, "locations": [ "azure:eastus", "aws:eu-west-3" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "min_failure_duration": 0, "min_location_failed": 1, "monitor_options": { "include_tags": true, "locked": false, "new_host_delay": 300, "notify_audit": false, "notify_no_data": false, "renotify_interval": 0 }, "tick_every": 60 }, "status": "live", "subtype": "http", "tags": [ "env:production" ], "type": "api" } EOF
## Create a Multistep API test # Example of a multistep API test running on a fake furniture store. # It creates a card, select a product and then add the product to the card.
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "steps": [ { "assertions": [ { "operator": "lessThan", "target": 30000, "type": "responseTime" } ], "extractedValues": [ { "field": "location", "name": "CART_ID", "parser": { "type": "regex", "value": "(?:[^\\\\/](?!(\\\\|/)))+$" }, "type": "http_header" } ], "name": "Get a cart", "request": { "method": "POST", "timeout": 30, "url": "https://api.shopist.io/carts" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 200, "type": "statusCode" } ], "extractedValues": [ { "name": "PRODUCT_ID", "parser": { "type": "json_path", "value": "$[0].id['$oid']" }, "type": "http_body" } ], "name": "Get a product", "request": { "method": "GET", "timeout": 30, "url": "https://api.shopist.io/products.json" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 201, "type": "statusCode" } ], "name": "Add product to cart", "request": { "body": "{\n \"cart_item\": {\n \"product_id\": \"{{ PRODUCT_ID }}\",\n \"amount_paid\": 500,\n \"quantity\": 1\n },\n \"cart_id\": \"{{ CART_ID }}\"\n}", "headers": { "content-type": "application/json" }, "method": "POST", "timeout": 30, "url": "https://api.shopist.io/add_item.json" }, "subtype": "http" } ] }, "locations": [ "aws:us-west-2" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "ci": { "executionRule": "blocking" }, "min_failure_duration": 5400, "min_location_failed": 1, "monitor_options": { "renotify_interval": 0 }, "retry": { "count": 3, "interval": 300 }, "tick_every": 900 }, "status": "live", "subtype": "multi", "tags": [ "env:prod" ], "type": "api" } EOF
                          ## Create an API test.
# Example of an API test.

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [ { "operator": "lessThan", "target": 1000, "type": "responseTime" }, { "operator": "is", "target": 200, "type": "statusCode" }, { "operator": "is", "property": "content-type", "target": "text/html; charset=UTF-8", "type": "header" } ], "request": { "method": "GET", "url": "https://example.com" } }, "locations": [ "azure:eastus", "aws:eu-west-3" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "min_failure_duration": 0, "min_location_failed": 1, "monitor_options": { "include_tags": true, "locked": false, "new_host_delay": 300, "notify_audit": false, "notify_no_data": false, "renotify_interval": 0 }, "tick_every": 60 }, "status": "live", "subtype": "http", "tags": [ "env:production" ], "type": "api" } EOF
## Create a Multistep API test # Example of a multistep API test running on a fake furniture store. # It creates a card, select a product and then add the product to the card.
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "steps": [ { "assertions": [ { "operator": "lessThan", "target": 30000, "type": "responseTime" } ], "extractedValues": [ { "field": "location", "name": "CART_ID", "parser": { "type": "regex", "value": "(?:[^\\\\/](?!(\\\\|/)))+$" }, "type": "http_header" } ], "name": "Get a cart", "request": { "method": "POST", "timeout": 30, "url": "https://api.shopist.io/carts" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 200, "type": "statusCode" } ], "extractedValues": [ { "name": "PRODUCT_ID", "parser": { "type": "json_path", "value": "$[0].id['$oid']" }, "type": "http_body" } ], "name": "Get a product", "request": { "method": "GET", "timeout": 30, "url": "https://api.shopist.io/products.json" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 201, "type": "statusCode" } ], "name": "Add product to cart", "request": { "body": "{\n \"cart_item\": {\n \"product_id\": \"{{ PRODUCT_ID }}\",\n \"amount_paid\": 500,\n \"quantity\": 1\n },\n \"cart_id\": \"{{ CART_ID }}\"\n}", "headers": { "content-type": "application/json" }, "method": "POST", "timeout": 30, "url": "https://api.shopist.io/add_item.json" }, "subtype": "http" } ] }, "locations": [ "aws:us-west-2" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "ci": { "executionRule": "blocking" }, "min_failure_duration": 5400, "min_location_failed": 1, "monitor_options": { "renotify_interval": 0 }, "retry": { "count": 3, "interval": 300 }, "tick_every": 900 }, "status": "live", "subtype": "multi", "tags": [ "env:prod" ], "type": "api" } EOF
                          ## Create an API test.
# Example of an API test.

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [ { "operator": "lessThan", "target": 1000, "type": "responseTime" }, { "operator": "is", "target": 200, "type": "statusCode" }, { "operator": "is", "property": "content-type", "target": "text/html; charset=UTF-8", "type": "header" } ], "request": { "method": "GET", "url": "https://example.com" } }, "locations": [ "azure:eastus", "aws:eu-west-3" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "min_failure_duration": 0, "min_location_failed": 1, "monitor_options": { "include_tags": true, "locked": false, "new_host_delay": 300, "notify_audit": false, "notify_no_data": false, "renotify_interval": 0 }, "tick_every": 60 }, "status": "live", "subtype": "http", "tags": [ "env:production" ], "type": "api" } EOF
## Create a Multistep API test # Example of a multistep API test running on a fake furniture store. # It creates a card, select a product and then add the product to the card.
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "steps": [ { "assertions": [ { "operator": "lessThan", "target": 30000, "type": "responseTime" } ], "extractedValues": [ { "field": "location", "name": "CART_ID", "parser": { "type": "regex", "value": "(?:[^\\\\/](?!(\\\\|/)))+$" }, "type": "http_header" } ], "name": "Get a cart", "request": { "method": "POST", "timeout": 30, "url": "https://api.shopist.io/carts" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 200, "type": "statusCode" } ], "extractedValues": [ { "name": "PRODUCT_ID", "parser": { "type": "json_path", "value": "$[0].id['$oid']" }, "type": "http_body" } ], "name": "Get a product", "request": { "method": "GET", "timeout": 30, "url": "https://api.shopist.io/products.json" }, "subtype": "http" }, { "assertions": [ { "operator": "is", "target": 201, "type": "statusCode" } ], "name": "Add product to cart", "request": { "body": "{\n \"cart_item\": {\n \"product_id\": \"{{ PRODUCT_ID }}\",\n \"amount_paid\": 500,\n \"quantity\": 1\n },\n \"cart_id\": \"{{ CART_ID }}\"\n}", "headers": { "content-type": "application/json" }, "method": "POST", "timeout": 30, "url": "https://api.shopist.io/add_item.json" }, "subtype": "http" } ] }, "locations": [ "aws:us-west-2" ], "message": "MY_NOTIFICATION_MESSAGE", "name": "MY_TEST_NAME", "options": { "ci": { "executionRule": "blocking" }, "min_failure_duration": 5400, "min_location_failed": 1, "monitor_options": { "renotify_interval": 0 }, "retry": { "count": 3, "interval": 300 }, "tick_every": 900 }, "status": "live", "subtype": "multi", "tags": [ "env:prod" ], "type": "api" } EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browserhttps://api.datadoghq.eu/api/v1/synthetics/tests/browserhttps://api.ddog-gov.com/api/v1/synthetics/tests/browserhttps://api.datadoghq.com/api/v1/synthetics/tests/browserhttps://api.us3.datadoghq.com/api/v1/synthetics/tests/browserhttps://api.us5.datadoghq.com/api/v1/synthetics/tests/browser

Información general

Crea un test de navegador Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles del test a crear.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic browser test.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

setCookie

string

Cookies to be used for the request, using the Set-Cookie syntax.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test. Message can either be text or an empty string.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, browser. Allowed enum values: browser

default: browser

{
  "config": {
    "assertions": [],
    "configVariables": [
      {
        "example": "content-type",
        "name": "PROPERTY",
        "pattern": "content-type",
        "type": "text"
      }
    ],
    "request": {
      "method": "GET",
      "url": "https://datadoghq.com",
      "certificateDomains": [
        "https://datadoghq.com"
      ]
    },
    "setCookie": "name:test"
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "Test message",
  "name": "Example-Synthetic",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": true,
    "device_ids": [
      "tablet"
    ],
    "disableCors": true,
    "follow_redirects": true,
    "min_failure_duration": 10,
    "min_location_failed": 1,
    "noScreenshot": true,
    "retry": {
      "count": 2,
      "interval": 10
    },
    "rumSettings": {
      "isEnabled": true,
      "applicationId": "mockApplicationId",
      "clientTokenId": 12345
    },
    "tick_every": 300,
    "ci": {
      "executionRule": "skipped"
    },
    "ignoreServerCertificateError": true,
    "disableCsp": true,
    "initialNavigationTimeout": 200
  },
  "tags": [
    "testing:browser"
  ],
  "type": "browser",
  "steps": [
    {
      "allowFailure": false,
      "isCritical": true,
      "name": "Refresh page",
      "params": {},
      "type": "refresh"
    }
  ]
}
{
  "config": {
    "assertions": [],
    "variables": [
      {
        "type": "text",
        "name": "TEST_VARIABLE",
        "pattern": "secret",
        "secure": true,
        "example": "secret"
      }
    ],
    "configVariables": [
      {
        "example": "content-type",
        "name": "PROPERTY",
        "pattern": "content-type",
        "type": "text",
        "secure": true
      }
    ],
    "request": {
      "method": "GET",
      "url": "https://datadoghq.com"
    },
    "setCookie": "name:test"
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "Test message",
  "name": "Example-Synthetic",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": true,
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": true,
    "follow_redirects": true,
    "min_failure_duration": 10,
    "min_location_failed": 1,
    "noScreenshot": true,
    "retry": {
      "count": 2,
      "interval": 10
    },
    "tick_every": 300,
    "enableProfiling": true,
    "enableSecurityTesting": true
  },
  "tags": [
    "testing:browser"
  ],
  "type": "browser",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": true,
      "exitIfSucceed": true,
      "isCritical": true,
      "name": "Refresh page",
      "params": {},
      "type": "refresh"
    }
  ]
}
{
  "config": {
    "assertions": [],
    "configVariables": [
      {
        "example": "content-type",
        "name": "PROPERTY",
        "pattern": "content-type",
        "type": "text"
      }
    ],
    "request": {
      "method": "GET",
      "url": "https://datadoghq.com"
    },
    "setCookie": "name:test"
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "Test message",
  "name": "Example-Synthetic",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": true,
    "device_ids": [
      "tablet"
    ],
    "disableCors": true,
    "follow_redirects": true,
    "min_failure_duration": 10,
    "min_location_failed": 1,
    "noScreenshot": true,
    "retry": {
      "count": 2,
      "interval": 10
    },
    "tick_every": 300,
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        },
        {
          "day": 3,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    }
  },
  "tags": [
    "testing:browser"
  ],
  "type": "browser",
  "steps": [
    {
      "allowFailure": false,
      "isCritical": true,
      "name": "Refresh page",
      "params": {},
      "type": "refresh"
    }
  ]
}

Respuesta

OK - Returns the created test details.

Object containing details about a Synthetic browser test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic browser test.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

setCookie

string

Cookies to be used for the request, using the Set-Cookie syntax.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test. Message can either be text or an empty string.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, browser. Allowed enum values: browser

default: browser

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "setCookie": "string",
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "",
  "monitor_id": "integer",
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:prod"
  ],
  "type": "browser"
}

- JSON format is wrong - Creation failed

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Test quota is reached

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [], "configVariables": [ { "example": "content-type", "name": "PROPERTY", "pattern": "content-type", "type": "text" } ], "request": { "method": "GET", "url": "https://datadoghq.com", "certificateDomains": [ "https://datadoghq.com" ] }, "setCookie": "name:test" }, "locations": [ "aws:us-east-2" ], "message": "Test message", "name": "Example-Synthetic", "options": { "accept_self_signed": false, "allow_insecure": true, "device_ids": [ "tablet" ], "disableCors": true, "follow_redirects": true, "min_failure_duration": 10, "min_location_failed": 1, "noScreenshot": true, "retry": { "count": 2, "interval": 10 }, "rumSettings": { "isEnabled": true, "applicationId": "mockApplicationId", "clientTokenId": 12345 }, "tick_every": 300, "ci": { "executionRule": "skipped" }, "ignoreServerCertificateError": true, "disableCsp": true, "initialNavigationTimeout": 200 }, "tags": [ "testing:browser" ], "type": "browser", "steps": [ { "allowFailure": false, "isCritical": true, "name": "Refresh page", "params": {}, "type": "refresh" } ] } EOF
                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [], "variables": [ { "type": "text", "name": "TEST_VARIABLE", "pattern": "secret", "secure": true, "example": "secret" } ], "configVariables": [ { "example": "content-type", "name": "PROPERTY", "pattern": "content-type", "type": "text", "secure": true } ], "request": { "method": "GET", "url": "https://datadoghq.com" }, "setCookie": "name:test" }, "locations": [ "aws:us-east-2" ], "message": "Test message", "name": "Example-Synthetic", "options": { "accept_self_signed": false, "allow_insecure": true, "device_ids": [ "chrome.laptop_large" ], "disableCors": true, "follow_redirects": true, "min_failure_duration": 10, "min_location_failed": 1, "noScreenshot": true, "retry": { "count": 2, "interval": 10 }, "tick_every": 300, "enableProfiling": true, "enableSecurityTesting": true }, "tags": [ "testing:browser" ], "type": "browser", "steps": [ { "allowFailure": false, "alwaysExecute": true, "exitIfSucceed": true, "isCritical": true, "name": "Refresh page", "params": {}, "type": "refresh" } ] } EOF
                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [], "configVariables": [ { "example": "content-type", "name": "PROPERTY", "pattern": "content-type", "type": "text" } ], "request": { "method": "GET", "url": "https://datadoghq.com" }, "setCookie": "name:test" }, "locations": [ "aws:us-east-2" ], "message": "Test message", "name": "Example-Synthetic", "options": { "accept_self_signed": false, "allow_insecure": true, "device_ids": [ "tablet" ], "disableCors": true, "follow_redirects": true, "min_failure_duration": 10, "min_location_failed": 1, "noScreenshot": true, "retry": { "count": 2, "interval": 10 }, "tick_every": 300, "scheduling": { "timeframes": [ { "day": 1, "from": "07:00", "to": "16:00" }, { "day": 3, "from": "07:00", "to": "16:00" } ], "timezone": "America/New_York" } }, "tags": [ "testing:browser" ], "type": "browser", "steps": [ { "allowFailure": false, "isCritical": true, "name": "Refresh page", "params": {}, "type": "refresh" } ] } EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/mobilehttps://api.datadoghq.eu/api/v1/synthetics/tests/mobilehttps://api.ddog-gov.com/api/v1/synthetics/tests/mobilehttps://api.datadoghq.com/api/v1/synthetics/tests/mobilehttps://api.us3.datadoghq.com/api/v1/synthetics/tests/mobilehttps://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile

Información general

Cree un test móvil Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles del test a crear.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic mobile test.

initialApplicationArguments

object

Initial application arguments for a mobile test.

<any-key>

string

A single application argument.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

device_ids

[string]

Array with the different device IDs used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

allowApplicationCrash

boolean

A boolean to set if an application crash would mark the test as failed.

bindings

[object]

Array of bindings used for the mobile test.

principals

[string]

List of principals for a mobile test binding.

relation

enum

The type of relation for the binding. Allowed enum values: editor,viewer

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

defaultStepTimeout

int32

The default timeout for steps in the test (in seconds).

device_ids [required]

[string]

For mobile test, array with the different device IDs used to run the test.

disableAutoAcceptAlert

boolean

A boolean to disable auto accepting alerts.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

mobileApplication [required]

object

Mobile application for mobile synthetics test.

applicationId [required]

string

Application ID of the mobile application.

referenceId [required]

string

Reference ID of the mobile application.

referenceType [required]

enum

Reference type for the mobile application for a mobile synthetics test. Allowed enum values: latest,version

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every [required]

int64

The frequency at which to run the Synthetic test (in seconds).

verbosity

int32

The level of verbosity for the mobile test. This field can not be set by a user.

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

hasNewStepElement

boolean

A boolean set to determine if the step has a new step element.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name [required]

string

The name of the step.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

params [required]

object

The parameters of a mobile step.

check

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

delay

int64

Number of milliseconds to wait between inputs in a typeText step type.

direction

enum

The direction of the scroll for a scrollToElement step type. Allowed enum values: up,down,left,right

element

object

Information about the element used for a step.

context

string

Context of the element.

contextType

enum

Type of the context that the element is in. Allowed enum values: native,web

elementDescription

string

Description of the element.

multiLocator

object

Multi-locator to find the element.

relativePosition

object

Position of the action relative to the element.

x

double

The relativePosition on the x axis for the element.

y

double

The relativePosition on the y axis for the element.

textContent

string

Text content of the element.

userLocator

object

User locator to find the element.

failTestOnCannotLocate

boolean

Whether if the test should fail if the element cannot be found.

values

[object]

Values of the user locator.

type

enum

Type of a user locator. Allowed enum values: accessibility-id,id,ios-predicate-string,ios-class-chain,xpath

value

string

Value of a user locator.

viewName

string

Name of the view of the element.

enabled

boolean

Boolean to change the state of the wifi for a toggleWiFi step type.

maxScrolls

int64

Maximum number of scrolls to do for a scrollToElement step type.

positions

[object]

List of positions for the flick step type. The maximum is 10 flicks per step

x

double

The x position for the flick.

y

double

The y position for the flick.

subtestPublicId

string

Public ID of the test to be played as part of a playSubTest step type.

value

 <oneOf>

Values used in the step for in multiple step types.

Option 1

string

Value used in the step for in multiple step types.

Option 2

int64

Value used in the step for in multiple step types.

variable

object

Variable object for extractVariable step type.

example [required]

string

An example for the variable.

name [required]

string

The variable name.

withEnter

boolean

Boolean to indicate if Enter should be pressed at the end of the typeText step type.

x

double

Amount to scroll by on the x axis for a scroll step type.

y

double

Amount to scroll by on the y axis for a scroll step type.

publicId

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type [required]

enum

Step type used in your mobile Synthetic test. Allowed enum values: assertElementContent,assertScreenContains,assertScreenLacks,doubleTap,extractVariable,flick,openDeeplink,playSubTest,pressBack,restartApplication,rotate,scroll,scrollToElement,tap,toggleWiFi,typeText,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, mobile. Allowed enum values: mobile

default: mobile

{
  "name": "Example-Synthetic",
  "status": "paused",
  "type": "mobile",
  "config": {
    "variables": []
  },
  "message": "",
  "options": {
    "device_ids": [
      "synthetics:mobile:device:iphone_15_ios_17"
    ],
    "mobileApplication": {
      "applicationId": "ab0e0aed-536d-411a-9a99-5428c27d8f8e",
      "referenceId": "6115922a-5f5d-455e-bc7e-7955a57f3815",
      "referenceType": "version"
    },
    "tick_every": 3600
  },
  "steps": []
}

Respuesta

OK - Returns the created test details.

Object containing details about a Synthetic mobile test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic mobile test.

initialApplicationArguments

object

Initial application arguments for a mobile test.

<any-key>

string

A single application argument.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

device_ids

[string]

Array with the different device IDs used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

allowApplicationCrash

boolean

A boolean to set if an application crash would mark the test as failed.

bindings

[object]

Array of bindings used for the mobile test.

principals

[string]

List of principals for a mobile test binding.

relation

enum

The type of relation for the binding. Allowed enum values: editor,viewer

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

defaultStepTimeout

int32

The default timeout for steps in the test (in seconds).

device_ids [required]

[string]

For mobile test, array with the different device IDs used to run the test.

disableAutoAcceptAlert

boolean

A boolean to disable auto accepting alerts.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

mobileApplication [required]

object

Mobile application for mobile synthetics test.

applicationId [required]

string

Application ID of the mobile application.

referenceId [required]

string

Reference ID of the mobile application.

referenceType [required]

enum

Reference type for the mobile application for a mobile synthetics test. Allowed enum values: latest,version

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every [required]

int64

The frequency at which to run the Synthetic test (in seconds).

verbosity

int32

The level of verbosity for the mobile test. This field can not be set by a user.

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

hasNewStepElement

boolean

A boolean set to determine if the step has a new step element.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name [required]

string

The name of the step.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

params [required]

object

The parameters of a mobile step.

check

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

delay

int64

Number of milliseconds to wait between inputs in a typeText step type.

direction

enum

The direction of the scroll for a scrollToElement step type. Allowed enum values: up,down,left,right

element

object

Information about the element used for a step.

context

string

Context of the element.

contextType

enum

Type of the context that the element is in. Allowed enum values: native,web

elementDescription

string

Description of the element.

multiLocator

object

Multi-locator to find the element.

relativePosition

object

Position of the action relative to the element.

x

double

The relativePosition on the x axis for the element.

y

double

The relativePosition on the y axis for the element.

textContent

string

Text content of the element.

userLocator

object

User locator to find the element.

failTestOnCannotLocate

boolean

Whether if the test should fail if the element cannot be found.

values

[object]

Values of the user locator.

type

enum

Type of a user locator. Allowed enum values: accessibility-id,id,ios-predicate-string,ios-class-chain,xpath

value

string

Value of a user locator.

viewName

string

Name of the view of the element.

enabled

boolean

Boolean to change the state of the wifi for a toggleWiFi step type.

maxScrolls

int64

Maximum number of scrolls to do for a scrollToElement step type.

positions

[object]

List of positions for the flick step type. The maximum is 10 flicks per step

x

double

The x position for the flick.

y

double

The y position for the flick.

subtestPublicId

string

Public ID of the test to be played as part of a playSubTest step type.

value

 <oneOf>

Values used in the step for in multiple step types.

Option 1

string

Value used in the step for in multiple step types.

Option 2

int64

Value used in the step for in multiple step types.

variable

object

Variable object for extractVariable step type.

example [required]

string

An example for the variable.

name [required]

string

The variable name.

withEnter

boolean

Boolean to indicate if Enter should be pressed at the end of the typeText step type.

x

double

Amount to scroll by on the x axis for a scroll step type.

y

double

Amount to scroll by on the y axis for a scroll step type.

publicId

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type [required]

enum

Step type used in your mobile Synthetic test. Allowed enum values: assertElementContent,assertScreenContains,assertScreenLacks,doubleTap,extractVariable,flick,openDeeplink,playSubTest,pressBack,restartApplication,rotate,scroll,scrollToElement,tap,toggleWiFi,typeText,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, mobile. Allowed enum values: mobile

default: mobile

{
  "config": {
    "initialApplicationArguments": {
      "<any-key>": "string"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "device_ids": [
    "chrome.laptop_large"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "allowApplicationCrash": false,
    "bindings": [
      {
        "principals": [],
        "relation": "string"
      }
    ],
    "ci": {
      "executionRule": "blocking"
    },
    "defaultStepTimeout": "integer",
    "device_ids": [
      "synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"
    ],
    "disableAutoAcceptAlert": false,
    "min_failure_duration": "integer",
    "mobileApplication": {
      "applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa",
      "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab",
      "referenceType": "latest"
    },
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": 300,
    "verbosity": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "hasNewStepElement": false,
      "isCritical": false,
      "name": "",
      "noScreenshot": false,
      "params": {
        "check": "string",
        "delay": "integer",
        "direction": "string",
        "element": {
          "context": "string",
          "contextType": "string",
          "elementDescription": "string",
          "multiLocator": {},
          "relativePosition": {
            "x": "number",
            "y": "number"
          },
          "textContent": "string",
          "userLocator": {
            "failTestOnCannotLocate": false,
            "values": [
              {
                "type": "string",
                "value": "string"
              }
            ]
          },
          "viewName": "string"
        },
        "enabled": false,
        "maxScrolls": "integer",
        "positions": [
          {
            "x": "number",
            "y": "number"
          }
        ],
        "subtestPublicId": "string",
        "value": {
          "description": "undefined",
          "type": "undefined"
        },
        "variable": {
          "example": "",
          "name": "VAR_NAME"
        },
        "withEnter": false,
        "x": "number",
        "y": "number"
      },
      "publicId": "pub-lic-id0",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:production"
  ],
  "type": "mobile"
}

- JSON format is wrong - Creation failed

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Test quota is reached

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "name": "Example-Synthetic", "status": "paused", "type": "mobile", "config": { "variables": [] }, "message": "", "options": { "device_ids": [ "synthetics:mobile:device:iphone_15_ios_17" ], "mobileApplication": { "applicationId": "ab0e0aed-536d-411a-9a99-5428c27d8f8e", "referenceId": "6115922a-5f5d-455e-bc7e-7955a57f3815", "referenceType": "version" }, "tick_every": 3600 }, "steps": [] } EOF

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/mobile/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/mobile/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}

Información general

Edita la configuración de un test móvil Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Solicitud

Body Data (required)

Nuevos detalles del test a guardar.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic mobile test.

initialApplicationArguments

object

Initial application arguments for a mobile test.

<any-key>

string

A single application argument.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

device_ids

[string]

Array with the different device IDs used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

allowApplicationCrash

boolean

A boolean to set if an application crash would mark the test as failed.

bindings

[object]

Array of bindings used for the mobile test.

principals

[string]

List of principals for a mobile test binding.

relation

enum

The type of relation for the binding. Allowed enum values: editor,viewer

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

defaultStepTimeout

int32

The default timeout for steps in the test (in seconds).

device_ids [required]

[string]

For mobile test, array with the different device IDs used to run the test.

disableAutoAcceptAlert

boolean

A boolean to disable auto accepting alerts.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

mobileApplication [required]

object

Mobile application for mobile synthetics test.

applicationId [required]

string

Application ID of the mobile application.

referenceId [required]

string

Reference ID of the mobile application.

referenceType [required]

enum

Reference type for the mobile application for a mobile synthetics test. Allowed enum values: latest,version

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every [required]

int64

The frequency at which to run the Synthetic test (in seconds).

verbosity

int32

The level of verbosity for the mobile test. This field can not be set by a user.

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

hasNewStepElement

boolean

A boolean set to determine if the step has a new step element.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name [required]

string

The name of the step.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

params [required]

object

The parameters of a mobile step.

check

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

delay

int64

Number of milliseconds to wait between inputs in a typeText step type.

direction

enum

The direction of the scroll for a scrollToElement step type. Allowed enum values: up,down,left,right

element

object

Information about the element used for a step.

context

string

Context of the element.

contextType

enum

Type of the context that the element is in. Allowed enum values: native,web

elementDescription

string

Description of the element.

multiLocator

object

Multi-locator to find the element.

relativePosition

object

Position of the action relative to the element.

x

double

The relativePosition on the x axis for the element.

y

double

The relativePosition on the y axis for the element.

textContent

string

Text content of the element.

userLocator

object

User locator to find the element.

failTestOnCannotLocate

boolean

Whether if the test should fail if the element cannot be found.

values

[object]

Values of the user locator.

type

enum

Type of a user locator. Allowed enum values: accessibility-id,id,ios-predicate-string,ios-class-chain,xpath

value

string

Value of a user locator.

viewName

string

Name of the view of the element.

enabled

boolean

Boolean to change the state of the wifi for a toggleWiFi step type.

maxScrolls

int64

Maximum number of scrolls to do for a scrollToElement step type.

positions

[object]

List of positions for the flick step type. The maximum is 10 flicks per step

x

double

The x position for the flick.

y

double

The y position for the flick.

subtestPublicId

string

Public ID of the test to be played as part of a playSubTest step type.

value

 <oneOf>

Values used in the step for in multiple step types.

Option 1

string

Value used in the step for in multiple step types.

Option 2

int64

Value used in the step for in multiple step types.

variable

object

Variable object for extractVariable step type.

example [required]

string

An example for the variable.

name [required]

string

The variable name.

withEnter

boolean

Boolean to indicate if Enter should be pressed at the end of the typeText step type.

x

double

Amount to scroll by on the x axis for a scroll step type.

y

double

Amount to scroll by on the y axis for a scroll step type.

publicId

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type [required]

enum

Step type used in your mobile Synthetic test. Allowed enum values: assertElementContent,assertScreenContains,assertScreenLacks,doubleTap,extractVariable,flick,openDeeplink,playSubTest,pressBack,restartApplication,rotate,scroll,scrollToElement,tap,toggleWiFi,typeText,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, mobile. Allowed enum values: mobile

default: mobile

{
  "name": "Example-Synthetic-updated",
  "status": "paused",
  "type": "mobile",
  "config": {
    "variables": []
  },
  "message": "",
  "options": {
    "device_ids": [
      "synthetics:mobile:device:iphone_15_ios_17"
    ],
    "mobileApplication": {
      "applicationId": "ab0e0aed-536d-411a-9a99-5428c27d8f8e",
      "referenceId": "6115922a-5f5d-455e-bc7e-7955a57f3815",
      "referenceType": "version"
    },
    "tick_every": 3600
  },
  "steps": []
}

Respuesta

OK

Object containing details about a Synthetic mobile test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic mobile test.

initialApplicationArguments

object

Initial application arguments for a mobile test.

<any-key>

string

A single application argument.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

device_ids

[string]

Array with the different device IDs used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

allowApplicationCrash

boolean

A boolean to set if an application crash would mark the test as failed.

bindings

[object]

Array of bindings used for the mobile test.

principals

[string]

List of principals for a mobile test binding.

relation

enum

The type of relation for the binding. Allowed enum values: editor,viewer

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

defaultStepTimeout

int32

The default timeout for steps in the test (in seconds).

device_ids [required]

[string]

For mobile test, array with the different device IDs used to run the test.

disableAutoAcceptAlert

boolean

A boolean to disable auto accepting alerts.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

mobileApplication [required]

object

Mobile application for mobile synthetics test.

applicationId [required]

string

Application ID of the mobile application.

referenceId [required]

string

Reference ID of the mobile application.

referenceType [required]

enum

Reference type for the mobile application for a mobile synthetics test. Allowed enum values: latest,version

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every [required]

int64

The frequency at which to run the Synthetic test (in seconds).

verbosity

int32

The level of verbosity for the mobile test. This field can not be set by a user.

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

hasNewStepElement

boolean

A boolean set to determine if the step has a new step element.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name [required]

string

The name of the step.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

params [required]

object

The parameters of a mobile step.

check

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

delay

int64

Number of milliseconds to wait between inputs in a typeText step type.

direction

enum

The direction of the scroll for a scrollToElement step type. Allowed enum values: up,down,left,right

element

object

Information about the element used for a step.

context

string

Context of the element.

contextType

enum

Type of the context that the element is in. Allowed enum values: native,web

elementDescription

string

Description of the element.

multiLocator

object

Multi-locator to find the element.

relativePosition

object

Position of the action relative to the element.

x

double

The relativePosition on the x axis for the element.

y

double

The relativePosition on the y axis for the element.

textContent

string

Text content of the element.

userLocator

object

User locator to find the element.

failTestOnCannotLocate

boolean

Whether if the test should fail if the element cannot be found.

values

[object]

Values of the user locator.

type

enum

Type of a user locator. Allowed enum values: accessibility-id,id,ios-predicate-string,ios-class-chain,xpath

value

string

Value of a user locator.

viewName

string

Name of the view of the element.

enabled

boolean

Boolean to change the state of the wifi for a toggleWiFi step type.

maxScrolls

int64

Maximum number of scrolls to do for a scrollToElement step type.

positions

[object]

List of positions for the flick step type. The maximum is 10 flicks per step

x

double

The x position for the flick.

y

double

The y position for the flick.

subtestPublicId

string

Public ID of the test to be played as part of a playSubTest step type.

value

 <oneOf>

Values used in the step for in multiple step types.

Option 1

string

Value used in the step for in multiple step types.

Option 2

int64

Value used in the step for in multiple step types.

variable

object

Variable object for extractVariable step type.

example [required]

string

An example for the variable.

name [required]

string

The variable name.

withEnter

boolean

Boolean to indicate if Enter should be pressed at the end of the typeText step type.

x

double

Amount to scroll by on the x axis for a scroll step type.

y

double

Amount to scroll by on the y axis for a scroll step type.

publicId

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type [required]

enum

Step type used in your mobile Synthetic test. Allowed enum values: assertElementContent,assertScreenContains,assertScreenLacks,doubleTap,extractVariable,flick,openDeeplink,playSubTest,pressBack,restartApplication,rotate,scroll,scrollToElement,tap,toggleWiFi,typeText,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, mobile. Allowed enum values: mobile

default: mobile

{
  "config": {
    "initialApplicationArguments": {
      "<any-key>": "string"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "device_ids": [
    "chrome.laptop_large"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "allowApplicationCrash": false,
    "bindings": [
      {
        "principals": [],
        "relation": "string"
      }
    ],
    "ci": {
      "executionRule": "blocking"
    },
    "defaultStepTimeout": "integer",
    "device_ids": [
      "synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"
    ],
    "disableAutoAcceptAlert": false,
    "min_failure_duration": "integer",
    "mobileApplication": {
      "applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa",
      "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab",
      "referenceType": "latest"
    },
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": 300,
    "verbosity": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "hasNewStepElement": false,
      "isCritical": false,
      "name": "",
      "noScreenshot": false,
      "params": {
        "check": "string",
        "delay": "integer",
        "direction": "string",
        "element": {
          "context": "string",
          "contextType": "string",
          "elementDescription": "string",
          "multiLocator": {},
          "relativePosition": {
            "x": "number",
            "y": "number"
          },
          "textContent": "string",
          "userLocator": {
            "failTestOnCannotLocate": false,
            "values": [
              {
                "type": "string",
                "value": "string"
              }
            ]
          },
          "viewName": "string"
        },
        "enabled": false,
        "maxScrolls": "integer",
        "positions": [
          {
            "x": "number",
            "y": "number"
          }
        ],
        "subtestPublicId": "string",
        "value": {
          "description": "undefined",
          "type": "undefined"
        },
        "variable": {
          "example": "",
          "name": "VAR_NAME"
        },
        "withEnter": false,
        "x": "number",
        "y": "number"
      },
      "publicId": "pub-lic-id0",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:production"
  ],
  "type": "mobile"
}

- JSON format is wrong - Updating sub-type is forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile/${public_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "name": "Example-Synthetic-updated", "status": "paused", "type": "mobile", "config": { "variables": [] }, "message": "", "options": { "device_ids": [ "synthetics:mobile:device:iphone_15_ios_17" ], "mobileApplication": { "applicationId": "ab0e0aed-536d-411a-9a99-5428c27d8f8e", "referenceId": "6115922a-5f5d-455e-bc7e-7955a57f3815", "referenceType": "version" }, "tick_every": 3600 }, "steps": [] } EOF

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/api/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/api/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/api/{public_id}

Información general

Edita la configuración de un test de API Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Solicitud

Body Data (required)

Nuevos detalles del test a guardar.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic API test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

steps

[ <oneOf>]

When the test subtype is multi, the steps of the test.

Option 1

object

The Test step used in a Synthetic multi-step API test.

allowFailure

boolean

Determines whether or not to continue with test if this step fails.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

exitIfSucceed

boolean

Determines whether or not to exit the test if the step succeeds.

extractedValues

[object]

Array of values to parse and save as variables from the response.

field

string

When type is http_header or grpc_metadata, name of the header or metadatum to extract.

name

string

Name of the variable to extract.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

secure

boolean

Determines whether or not the extracted value will be obfuscated.

type

enum

Property of the Synthetic Test Response to extract into a local variable. Allowed enum values: grpc_message,grpc_metadata,http_body,http_header,http_status_code

extractedValuesFromScript

string

Generate variables using JavaScript.

isCritical

boolean

Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allowFailure is true.

name [required]

string

The name of the step.

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

subtype [required]

enum

The subtype of the Synthetic multi-step API test step. Allowed enum values: http,grpc

Option 2

object

The Wait step used in a Synthetic multi-step API test.

name [required]

string

The name of the step.

subtype [required]

enum

The subtype of the Synthetic multi-step API wait step. Allowed enum values: wait

value [required]

int32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

variablesFromScript

string

Variables defined from JavaScript code.

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID for the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, api. Allowed enum values: api

default: api

{
  "config": {
    "assertions": [
      {
        "operator": "is",
        "property": "{{ PROPERTY }}",
        "target": "text/html",
        "type": "header"
      },
      {
        "operator": "lessThan",
        "target": 2000,
        "type": "responseTime"
      },
      {
        "operator": "validatesJSONPath",
        "target": {
          "jsonPath": "topKey",
          "operator": "isNot",
          "targetValue": "0"
        },
        "type": "body"
      },
      {
        "operator": "validatesJSONSchema",
        "target": {
          "metaSchema": "draft-07",
          "jsonSchema": "{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}"
        },
        "type": "body"
      }
    ],
    "configVariables": [
      {
        "example": "content-type",
        "name": "PROPERTY",
        "pattern": "content-type",
        "type": "text"
      }
    ],
    "request": {
      "certificate": {
        "cert": {
          "filename": "cert-filename",
          "updatedAt": "2020-10-16T09:23:24.857Z"
        },
        "key": {
          "filename": "key-filename",
          "updatedAt": "2020-10-16T09:23:24.857Z"
        }
      },
      "headers": {
        "unique": "examplesynthetic"
      },
      "method": "GET",
      "timeout": 10,
      "url": "https://datadoghq.com"
    }
  },
  "locations": [
    "aws:us-east-2"
  ],
  "message": "BDD test payload: synthetics_api_test_payload.json",
  "name": "Example-Synthetic-updated",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": true,
    "follow_redirects": true,
    "min_failure_duration": 10,
    "min_location_failed": 1,
    "monitor_name": "Test-TestSyntheticsAPITestLifecycle-1623076664",
    "monitor_priority": 5,
    "retry": {
      "count": 3,
      "interval": 10
    },
    "tick_every": 60
  },
  "status": "live",
  "subtype": "http",
  "tags": [
    "testing:api"
  ],
  "type": "api"
}

Respuesta

OK

Object containing details about a Synthetic API test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic API test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

steps

[ <oneOf>]

When the test subtype is multi, the steps of the test.

Option 1

object

The Test step used in a Synthetic multi-step API test.

allowFailure

boolean

Determines whether or not to continue with test if this step fails.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

exitIfSucceed

boolean

Determines whether or not to exit the test if the step succeeds.

extractedValues

[object]

Array of values to parse and save as variables from the response.

field

string

When type is http_header or grpc_metadata, name of the header or metadatum to extract.

name

string

Name of the variable to extract.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

secure

boolean

Determines whether or not the extracted value will be obfuscated.

type

enum

Property of the Synthetic Test Response to extract into a local variable. Allowed enum values: grpc_message,grpc_metadata,http_body,http_header,http_status_code

extractedValuesFromScript

string

Generate variables using JavaScript.

isCritical

boolean

Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allowFailure is true.

name [required]

string

The name of the step.

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

subtype [required]

enum

The subtype of the Synthetic multi-step API test step. Allowed enum values: http,grpc

Option 2

object

The Wait step used in a Synthetic multi-step API test.

name [required]

string

The name of the step.

subtype [required]

enum

The subtype of the Synthetic multi-step API wait step. Allowed enum values: wait

value [required]

int32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

variablesFromScript

string

Variables defined from JavaScript code.

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID for the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, api. Allowed enum values: api

default: api

{
  "config": {
    "assertions": [
      []
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "steps": [],
    "variablesFromScript": "dd.variable.set(\"FOO\", \"foo\")"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "subtype": "http",
  "tags": [
    "env:production"
  ],
  "type": "api"
}

- JSON format is wrong - Updating sub-type is forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api/${public_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [ { "operator": "is", "property": "{{ PROPERTY }}", "target": "text/html", "type": "header" }, { "operator": "lessThan", "target": 2000, "type": "responseTime" }, { "operator": "validatesJSONPath", "target": { "jsonPath": "topKey", "operator": "isNot", "targetValue": "0" }, "type": "body" }, { "operator": "validatesJSONSchema", "target": { "metaSchema": "draft-07", "jsonSchema": "{\"type\": \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}" }, "type": "body" } ], "configVariables": [ { "example": "content-type", "name": "PROPERTY", "pattern": "content-type", "type": "text" } ], "request": { "certificate": { "cert": { "filename": "cert-filename", "updatedAt": "2020-10-16T09:23:24.857Z" }, "key": { "filename": "key-filename", "updatedAt": "2020-10-16T09:23:24.857Z" } }, "headers": { "unique": "examplesynthetic" }, "method": "GET", "timeout": 10, "url": "https://datadoghq.com" } }, "locations": [ "aws:us-east-2" ], "message": "BDD test payload: synthetics_api_test_payload.json", "name": "Example-Synthetic-updated", "options": { "accept_self_signed": false, "allow_insecure": true, "follow_redirects": true, "min_failure_duration": 10, "min_location_failed": 1, "monitor_name": "Test-TestSyntheticsAPITestLifecycle-1623076664", "monitor_priority": 5, "retry": { "count": 3, "interval": 10 }, "tick_every": 60 }, "status": "live", "subtype": "http", "tags": [ "testing:api" ], "type": "api" } EOF

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/browser/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}

Información general

Edita la configuración de un test de navegador Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to edit.

Solicitud

Body Data (required)

Nuevos detalles del test a guardar.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic browser test.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

setCookie

string

Cookies to be used for the request, using the Set-Cookie syntax.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test. Message can either be text or an empty string.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, browser. Allowed enum values: browser

default: browser

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "setCookie": "string",
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "",
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:prod"
  ],
  "type": "browser"
}

Respuesta

OK

Object containing details about a Synthetic browser test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic browser test.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

setCookie

string

Cookies to be used for the request, using the Set-Cookie syntax.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test. Message can either be text or an empty string.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, browser. Allowed enum values: browser

default: browser

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "setCookie": "string",
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "",
  "monitor_id": "integer",
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:prod"
  ],
  "type": "browser"
}

- JSON format is wrong - Updating sub-type is forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/${public_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "assertions": [ {} ], "configVariables": [ { "name": "VARIABLE_NAME", "type": "text" } ], "request": { "proxy": { "url": "https://example.com" } }, "variables": [ { "name": "VARIABLE_NAME", "type": "text" } ] }, "locations": [ "aws:eu-west-3" ], "message": "", "name": "Example test name", "options": { "ci": { "executionRule": "blocking" }, "rumSettings": { "isEnabled": true }, "scheduling": { "timeframes": [ { "day": 1, "from": "07:00", "to": "16:00" } ], "timezone": "America/New_York" } }, "type": "browser" } EOF

PATCH https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}

Información general

Parchea la configuración de un test Synthetic con datos parciales. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to patch.

Solicitud

Body Data (required)

Lista de operaciones compatible con parches JSON

Expand All

Campo

Tipo

Descripción

data

[object]

Array of JSON Patch operations to perform on the test

op

enum

The operation to perform Allowed enum values: add,remove,replace,move,copy,test

path

string

The path to the value to modify

value

A value to use in a JSON Patch operation

{
  "data": [
    {
      "op": "replace",
      "path": "/name",
      "value": "New test name"
    },
    {
      "op": "remove",
      "path": "/config/assertions/0"
    }
  ]
}

Respuesta

OK

Object containing details about your Synthetic test.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "creator": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "monitor_id": "integer",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

- JSON format is wrong - Updating sub-type is forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/${public_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": [ { "op": "replace", "path": "/name", "value": "New test name" }, { "op": "remove", "path": "/config/assertions/0" } ] } EOF

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}/statushttps://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}/statushttps://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}/statushttps://api.datadoghq.com/api/v1/synthetics/tests/{public_id}/statushttps://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}/statushttps://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}/status

Información general

Pausa o inicia un test Synthetic cambiando el estado. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the Synthetic test to update.

Solicitud

Body Data (required)

Estado en el que se encuentra el test Synthetic.

Expand All

Campo

Tipo

Descripción

new_status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

{
  "new_status": "live"
}

Respuesta

OK - Returns a boolean indicating if the update was successful.

Expand All

Campo

Tipo

Descripción

No response body

{}

JSON format is wrong.

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/${public_id}/status" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF {} EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/trigger/cihttps://api.datadoghq.eu/api/v1/synthetics/tests/trigger/cihttps://api.ddog-gov.com/api/v1/synthetics/tests/trigger/cihttps://api.datadoghq.com/api/v1/synthetics/tests/trigger/cihttps://api.us3.datadoghq.com/api/v1/synthetics/tests/trigger/cihttps://api.us5.datadoghq.com/api/v1/synthetics/tests/trigger/ci

Información general

Activa un conjunto de tests Synthetic para la integración continua. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles de los tests a activar.

Expand All

Campo

Tipo

Descripción

tests

[object]

List of Synthetic tests with overrides.

allowInsecureCertificates

boolean

Disable certificate checks in API tests.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

string

Type of the data sent in a Synthetic API test.

cookies

string

Cookies for the request.

deviceIds

[string]

For browser test, array with the different device IDs used to run the test.

followRedirects

boolean

For API HTTP test, whether or not the test should follow redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

locations

[string]

Array of locations used to run the test.

metadata

object

Metadata for the Synthetic tests run.

ci

object

Description of the CI provider.

pipeline

object

Description of the CI pipeline.

url

string

URL of the pipeline.

provider

object

Description of the CI provider.

name

string

Name of the CI provider.

git

object

Git information.

branch

string

Branch name.

commitSha

string

The commit SHA.

public_id [required]

string

The public ID of the Synthetic test to trigger.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

startUrl

string

Starting URL for the browser test.

variables

object

Variables to replace in the test.

<any-key>

string

A single variable.

{
  "tests": [
    {
      "allowInsecureCertificates": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "string",
      "cookies": "string",
      "deviceIds": [
        "chrome.laptop_large"
      ],
      "followRedirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "locations": [
        "aws:eu-west-3"
      ],
      "metadata": {
        "ci": {
          "pipeline": {
            "url": "string"
          },
          "provider": {
            "name": "string"
          }
        },
        "git": {
          "branch": "string",
          "commitSha": "string"
        }
      },
      "public_id": "aaa-aaa-aaa",
      "retry": {
        "count": "integer",
        "interval": "number"
      },
      "startUrl": "string",
      "variables": {
        "<any-key>": "string"
      }
    }
  ]
}

Respuesta

OK

Object containing information about the tests triggered.

Expand All

Campo

Tipo

Descripción

batch_id

string

The public ID of the batch triggered.

locations

[object]

List of Synthetic locations.

id

int64

Unique identifier of the location.

name

string

Name of the location.

results

[object]

Information about the tests runs.

device

string

The device ID.

location

int64

The location ID of the test run.

public_id

string

The public ID of the Synthetic test.

result_id

string

ID of the result.

triggered_check_ids

[string]

The public IDs of the Synthetic test triggered.

{
  "batch_id": "string",
  "locations": [
    {
      "id": "integer",
      "name": "string"
    }
  ],
  "results": [
    {
      "device": "chrome.laptop_large",
      "location": "integer",
      "public_id": "string",
      "result_id": "string"
    }
  ],
  "triggered_check_ids": []
}

JSON format is wrong

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/trigger/ci" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "tests": [ { "public_id": "aaa-aaa-aaa" } ] } EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/triggerhttps://api.datadoghq.eu/api/v1/synthetics/tests/triggerhttps://api.ddog-gov.com/api/v1/synthetics/tests/triggerhttps://api.datadoghq.com/api/v1/synthetics/tests/triggerhttps://api.us3.datadoghq.com/api/v1/synthetics/tests/triggerhttps://api.us5.datadoghq.com/api/v1/synthetics/tests/trigger

Información general

Activa un conjunto de tests Synthetic. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Identificadores de los tests a activar.

Expand All

Campo

Tipo

Descripción

tests [required]

[object]

List of Synthetic tests.

metadata

object

Metadata for the Synthetic tests run.

ci

object

Description of the CI provider.

pipeline

object

Description of the CI pipeline.

url

string

URL of the pipeline.

provider

object

Description of the CI provider.

name

string

Name of the CI provider.

git

object

Git information.

branch

string

Branch name.

commitSha

string

The commit SHA.

public_id [required]

string

The public ID of the Synthetic test to trigger.

{
  "tests": [
    {
      "public_id": "123-abc-456"
    }
  ]
}

Respuesta

OK

Object containing information about the tests triggered.

Expand All

Campo

Tipo

Descripción

batch_id

string

The public ID of the batch triggered.

locations

[object]

List of Synthetic locations.

id

int64

Unique identifier of the location.

name

string

Name of the location.

results

[object]

Information about the tests runs.

device

string

The device ID.

location

int64

The location ID of the test run.

public_id

string

The public ID of the Synthetic test.

result_id

string

ID of the result.

triggered_check_ids

[string]

The public IDs of the Synthetic test triggered.

{
  "batch_id": "string",
  "locations": [
    {
      "id": "integer",
      "name": "string"
    }
  ],
  "results": [
    {
      "device": "chrome.laptop_large",
      "location": "integer",
      "public_id": "string",
      "result_id": "string"
    }
  ],
  "triggered_check_ids": []
}

Bad Request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/trigger" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "tests": [ { "public_id": "123-abc-456" } ] } EOF

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/mobile/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/mobile/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile/{public_id}

Información general

Obtén la configuración detallada asociada a un test móvil Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Respuesta

OK

Object containing details about a Synthetic mobile test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic mobile test.

initialApplicationArguments

object

Initial application arguments for a mobile test.

<any-key>

string

A single application argument.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

device_ids

[string]

Array with the different device IDs used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

allowApplicationCrash

boolean

A boolean to set if an application crash would mark the test as failed.

bindings

[object]

Array of bindings used for the mobile test.

principals

[string]

List of principals for a mobile test binding.

relation

enum

The type of relation for the binding. Allowed enum values: editor,viewer

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

defaultStepTimeout

int32

The default timeout for steps in the test (in seconds).

device_ids [required]

[string]

For mobile test, array with the different device IDs used to run the test.

disableAutoAcceptAlert

boolean

A boolean to disable auto accepting alerts.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

mobileApplication [required]

object

Mobile application for mobile synthetics test.

applicationId [required]

string

Application ID of the mobile application.

referenceId [required]

string

Reference ID of the mobile application.

referenceType [required]

enum

Reference type for the mobile application for a mobile synthetics test. Allowed enum values: latest,version

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every [required]

int64

The frequency at which to run the Synthetic test (in seconds).

verbosity

int32

The level of verbosity for the mobile test. This field can not be set by a user.

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

hasNewStepElement

boolean

A boolean set to determine if the step has a new step element.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name [required]

string

The name of the step.

noScreenshot

boolean

A boolean set to not take a screenshot for the step.

params [required]

object

The parameters of a mobile step.

check

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

delay

int64

Number of milliseconds to wait between inputs in a typeText step type.

direction

enum

The direction of the scroll for a scrollToElement step type. Allowed enum values: up,down,left,right

element

object

Information about the element used for a step.

context

string

Context of the element.

contextType

enum

Type of the context that the element is in. Allowed enum values: native,web

elementDescription

string

Description of the element.

multiLocator

object

Multi-locator to find the element.

relativePosition

object

Position of the action relative to the element.

x

double

The relativePosition on the x axis for the element.

y

double

The relativePosition on the y axis for the element.

textContent

string

Text content of the element.

userLocator

object

User locator to find the element.

failTestOnCannotLocate

boolean

Whether if the test should fail if the element cannot be found.

values

[object]

Values of the user locator.

type

enum

Type of a user locator. Allowed enum values: accessibility-id,id,ios-predicate-string,ios-class-chain,xpath

value

string

Value of a user locator.

viewName

string

Name of the view of the element.

enabled

boolean

Boolean to change the state of the wifi for a toggleWiFi step type.

maxScrolls

int64

Maximum number of scrolls to do for a scrollToElement step type.

positions

[object]

List of positions for the flick step type. The maximum is 10 flicks per step

x

double

The x position for the flick.

y

double

The y position for the flick.

subtestPublicId

string

Public ID of the test to be played as part of a playSubTest step type.

value

 <oneOf>

Values used in the step for in multiple step types.

Option 1

string

Value used in the step for in multiple step types.

Option 2

int64

Value used in the step for in multiple step types.

variable

object

Variable object for extractVariable step type.

example [required]

string

An example for the variable.

name [required]

string

The variable name.

withEnter

boolean

Boolean to indicate if Enter should be pressed at the end of the typeText step type.

x

double

Amount to scroll by on the x axis for a scroll step type.

y

double

Amount to scroll by on the y axis for a scroll step type.

publicId

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type [required]

enum

Step type used in your mobile Synthetic test. Allowed enum values: assertElementContent,assertScreenContains,assertScreenLacks,doubleTap,extractVariable,flick,openDeeplink,playSubTest,pressBack,restartApplication,rotate,scroll,scrollToElement,tap,toggleWiFi,typeText,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, mobile. Allowed enum values: mobile

default: mobile

{
  "config": {
    "initialApplicationArguments": {
      "<any-key>": "string"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "device_ids": [
    "chrome.laptop_large"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "allowApplicationCrash": false,
    "bindings": [
      {
        "principals": [],
        "relation": "string"
      }
    ],
    "ci": {
      "executionRule": "blocking"
    },
    "defaultStepTimeout": "integer",
    "device_ids": [
      "synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"
    ],
    "disableAutoAcceptAlert": false,
    "min_failure_duration": "integer",
    "mobileApplication": {
      "applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa",
      "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab",
      "referenceType": "latest"
    },
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": 300,
    "verbosity": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "hasNewStepElement": false,
      "isCritical": false,
      "name": "",
      "noScreenshot": false,
      "params": {
        "check": "string",
        "delay": "integer",
        "direction": "string",
        "element": {
          "context": "string",
          "contextType": "string",
          "elementDescription": "string",
          "multiLocator": {},
          "relativePosition": {
            "x": "number",
            "y": "number"
          },
          "textContent": "string",
          "userLocator": {
            "failTestOnCannotLocate": false,
            "values": [
              {
                "type": "string",
                "value": "string"
              }
            ]
          },
          "viewName": "string"
        },
        "enabled": false,
        "maxScrolls": "integer",
        "positions": [
          {
            "x": "number",
            "y": "number"
          }
        ],
        "subtestPublicId": "string",
        "value": {
          "description": "undefined",
          "type": "undefined"
        },
        "variable": {
          "example": "",
          "name": "VAR_NAME"
        },
        "withEnter": false,
        "x": "number",
        "y": "number"
      },
      "publicId": "pub-lic-id0",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:production"
  ],
  "type": "mobile"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/mobile/${public_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/api/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/api/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/api/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/api/{public_id}

Información general

Obtén la configuración detallada, asociada a un test de API Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Respuesta

OK

Object containing details about a Synthetic API test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic API test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

steps

[ <oneOf>]

When the test subtype is multi, the steps of the test.

Option 1

object

The Test step used in a Synthetic multi-step API test.

allowFailure

boolean

Determines whether or not to continue with test if this step fails.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

exitIfSucceed

boolean

Determines whether or not to exit the test if the step succeeds.

extractedValues

[object]

Array of values to parse and save as variables from the response.

field

string

When type is http_header or grpc_metadata, name of the header or metadatum to extract.

name

string

Name of the variable to extract.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

secure

boolean

Determines whether or not the extracted value will be obfuscated.

type

enum

Property of the Synthetic Test Response to extract into a local variable. Allowed enum values: grpc_message,grpc_metadata,http_body,http_header,http_status_code

extractedValuesFromScript

string

Generate variables using JavaScript.

isCritical

boolean

Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allowFailure is true.

name [required]

string

The name of the step.

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

subtype [required]

enum

The subtype of the Synthetic multi-step API test step. Allowed enum values: http,grpc

Option 2

object

The Wait step used in a Synthetic multi-step API test.

name [required]

string

The name of the step.

subtype [required]

enum

The subtype of the Synthetic multi-step API wait step. Allowed enum values: wait

value [required]

int32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

variablesFromScript

string

Variables defined from JavaScript code.

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID for the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, api. Allowed enum values: api

default: api

{
  "config": {
    "assertions": [
      []
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "steps": [],
    "variablesFromScript": "dd.variable.set(\"FOO\", \"foo\")"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "Notification message",
  "monitor_id": 12345678,
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "123-abc-456",
  "status": "live",
  "subtype": "http",
  "tags": [
    "env:production"
  ],
  "type": "api"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/api/${public_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/browser/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}

Información general

Obtén la configuración detallada (incluyendo los pasos), asociada a un test de navegador Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Respuesta

OK

Object containing details about a Synthetic browser test.

Expand All

Campo

Tipo

Descripción

config [required]

object

Configuration object for a Synthetic browser test.

assertions [required]

[ <oneOf>]

Array of assertions used for the test.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request [required]

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

setCookie

string

Cookies to be used for the request, using the Set-Cookie syntax.

variables

[object]

Array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

locations [required]

[string]

Array of locations used to run the test.

message [required]

string

Notification message associated with the test. Message can either be text or an empty string.

monitor_id

int64

The associated monitor ID.

name [required]

string

Name of the test.

options [required]

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The public ID of the test.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

Array of steps for the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

tags

[string]

Array of tags attached to the test.

type [required]

enum

Type of the Synthetic test, browser. Allowed enum values: browser

default: browser

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "setCookie": "string",
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "",
  "monitor_id": "integer",
  "name": "Example test name",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:prod"
  ],
  "type": "browser"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/${public_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.datadoghq.eu/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.ddog-gov.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.us3.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.us5.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_cap

Información general

Get the on-demand concurrency cap. This endpoint requires the billing_read permission.

Respuesta

OK

On-demand concurrency cap response.

Expand All

Campo

Tipo

Descripción

data

object

On-demand concurrency cap.

attributes

object

On-demand concurrency cap attributes.

on_demand_concurrency_cap

double

Value of the on-demand concurrency cap.

type

enum

On-demand concurrency cap type. Allowed enum values: on_demand_concurrency_cap

{
  "data": {
    "attributes": {
      "on_demand_concurrency_cap": "number"
    },
    "type": "string"
  }
}

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_cap" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/testshttps://api.datadoghq.eu/api/v1/synthetics/testshttps://api.ddog-gov.com/api/v1/synthetics/testshttps://api.datadoghq.com/api/v1/synthetics/testshttps://api.us3.datadoghq.com/api/v1/synthetics/testshttps://api.us5.datadoghq.com/api/v1/synthetics/tests

Información general

Obtén la lista de todos los tests Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Cadenas de consulta

Nombre

Tipo

Descripción

page_size

integer

Used for pagination. The number of tests returned in the page.

page_number

integer

Used for pagination. Which page you want to retrieve. Starts at zero.

Respuesta

OK - Returns the list of all Synthetic tests.

Object containing an array of Synthetic tests configuration.

Expand All

Campo

Tipo

Descripción

tests

[object]

Array of Synthetic tests configuration.

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "tests": [
    {
      "config": {
        "assertions": [
          {
            "operator": "contains",
            "property": "string",
            "target": 123456,
            "timingsScope": "string",
            "type": "statusCode"
          }
        ],
        "configVariables": [
          {
            "example": "string",
            "id": "string",
            "name": "VARIABLE_NAME",
            "pattern": "string",
            "secure": false,
            "type": "text"
          }
        ],
        "request": {
          "allow_insecure": false,
          "basicAuth": {
            "password": "PaSSw0RD!",
            "type": "web",
            "username": "my_username"
          },
          "body": "string",
          "bodyType": "text/plain",
          "callType": "unary",
          "certificate": {
            "cert": {
              "content": "string",
              "filename": "string",
              "updatedAt": "string"
            },
            "key": {
              "content": "string",
              "filename": "string",
              "updatedAt": "string"
            }
          },
          "certificateDomains": [],
          "compressedJsonDescriptor": "string",
          "compressedProtoFile": "string",
          "dnsServer": "string",
          "dnsServerPort": "string",
          "files": [
            {
              "bucketKey": "string",
              "content": "string",
              "name": "string",
              "originalFileName": "string",
              "size": "integer",
              "type": "string"
            }
          ],
          "follow_redirects": false,
          "headers": {
            "<any-key>": "string"
          },
          "host": "string",
          "httpVersion": "string",
          "message": "string",
          "metadata": {
            "<any-key>": "string"
          },
          "method": "string",
          "noSavingResponseBody": false,
          "numberOfPackets": "integer",
          "persistCookies": false,
          "port": {
            "description": "undefined",
            "format": "undefined",
            "type": "undefined"
          },
          "proxy": {
            "headers": {
              "<any-key>": "string"
            },
            "url": "https://example.com"
          },
          "query": {},
          "servername": "string",
          "service": "Greeter",
          "shouldTrackHops": false,
          "timeout": "number",
          "url": "https://example.com"
        },
        "variables": [
          {
            "example": "string",
            "id": "string",
            "name": "VARIABLE_NAME",
            "pattern": "string",
            "secure": false,
            "type": "text"
          }
        ]
      },
      "creator": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "locations": [
        "aws:eu-west-3"
      ],
      "message": "string",
      "monitor_id": "integer",
      "name": "string",
      "options": {
        "accept_self_signed": false,
        "allow_insecure": false,
        "checkCertificateRevocation": false,
        "ci": {
          "executionRule": "blocking"
        },
        "device_ids": [
          "chrome.laptop_large"
        ],
        "disableCors": false,
        "disableCsp": false,
        "enableProfiling": false,
        "enableSecurityTesting": false,
        "follow_redirects": false,
        "httpVersion": "string",
        "ignoreServerCertificateError": false,
        "initialNavigationTimeout": "integer",
        "min_failure_duration": "integer",
        "min_location_failed": "integer",
        "monitor_name": "string",
        "monitor_options": {
          "escalation_message": "string",
          "notification_preset_name": "string",
          "renotify_interval": "integer",
          "renotify_occurrences": "integer"
        },
        "monitor_priority": "integer",
        "noScreenshot": false,
        "restricted_roles": [
          "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        ],
        "retry": {
          "count": "integer",
          "interval": "number"
        },
        "rumSettings": {
          "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "clientTokenId": 12345,
          "isEnabled": true
        },
        "scheduling": {
          "timeframes": [
            {
              "day": 1,
              "from": "07:00",
              "to": "16:00"
            }
          ],
          "timezone": "America/New_York"
        },
        "tick_every": "integer"
      },
      "public_id": "string",
      "status": "live",
      "steps": [
        {
          "allowFailure": false,
          "alwaysExecute": false,
          "exitIfSucceed": false,
          "isCritical": false,
          "name": "string",
          "noScreenshot": false,
          "params": {},
          "public_id": "string",
          "timeout": "integer",
          "type": "assertElementContent"
        }
      ],
      "subtype": "http",
      "tags": [],
      "type": "string"
    }
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Synthetic Monitoring is not activated for the user.

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dog.get_all_synthetics_tests()

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"

POST https://api.ap1.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.datadoghq.eu/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.ddog-gov.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.us3.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_caphttps://api.us5.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_cap

Información general

Save new value for on-demand concurrency cap. This endpoint requires the billing_edit permission.

Solicitud

Body Data (required)

.

Expand All

Campo

Tipo

Descripción

on_demand_concurrency_cap

double

Value of the on-demand concurrency cap.

{
  "on_demand_concurrency_cap": 20
}

Respuesta

OK

On-demand concurrency cap response.

Expand All

Campo

Tipo

Descripción

data

object

On-demand concurrency cap.

attributes

object

On-demand concurrency cap attributes.

on_demand_concurrency_cap

double

Value of the on-demand concurrency cap.

type

enum

On-demand concurrency cap type. Allowed enum values: on_demand_concurrency_cap

{
  "data": {
    "attributes": {
      "on_demand_concurrency_cap": "number"
    },
    "type": "string"
  }
}

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/synthetics/settings/on_demand_concurrency_cap" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "on_demand_concurrency_cap": 20 } EOF

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}

Información general

Obtén un resultado completo específico de un test de API Synthetic determinado. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the API test to which the target result belongs.

result_id [required]

string

The ID of the result to get.

Respuesta

OK

Object returned describing a API test result.

Expand All

Campo

Tipo

Descripción

check

object

Object describing the API test configuration.

config [required]

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

check_time

double

When the API test was conducted.

check_version

int64

Version of the API test used.

probe_dc

string

Locations for which to query the API test results.

result

object

Object containing results for your Synthetic API test.

cert

object

Object describing the SSL certificate used for a Synthetic test.

cipher

string

Cipher used for the connection.

exponent

double

Exponent associated to the certificate.

extKeyUsage

[string]

Array of extensions and details used for the certificate.

fingerprint

string

MD5 digest of the DER-encoded Certificate information.

fingerprint256

string

SHA-1 digest of the DER-encoded Certificate information.

issuer

object

Object describing the issuer of a SSL certificate.

C

string

Country Name that issued the certificate.

CN

string

Common Name that issued certificate.

L

string

Locality that issued the certificate.

O

string

Organization that issued the certificate.

OU

string

Organizational Unit that issued the certificate.

ST

string

State Or Province Name that issued the certificate.

modulus

string

Modulus associated to the SSL certificate private key.

protocol

string

TLS protocol used for the test.

serialNumber

string

Serial Number assigned by Symantec to the SSL certificate.

subject

object

Object describing the SSL certificate used for the test.

C

string

Country Name associated with the certificate.

CN

string

Common Name that associated with the certificate.

L

string

Locality associated with the certificate.

O

string

Organization associated with the certificate.

OU

string

Organizational Unit associated with the certificate.

ST

string

State Or Province Name associated with the certificate.

altName

string

Subject Alternative Name associated with the certificate.

validFrom

date-time

Date from which the SSL certificate is valid.

validTo

date-time

Date until which the SSL certificate is valid.

eventType

enum

Status of a Synthetic test. Allowed enum values: not_scheduled,scheduled,finished,finished_with_error

failure

object

The API test failure details.

code

enum

Error code that can be returned by a Synthetic test. Allowed enum values: BODY_TOO_LARGE,DENIED,TOO_MANY_REDIRECTS,AUTHENTICATION_ERROR,DECRYPTION,INVALID_CHAR_IN_HEADER,HEADER_TOO_LARGE,HEADERS_INCOMPATIBLE_CONTENT_LENGTH,INVALID_REQUEST,REQUIRES_UPDATE,UNESCAPED_CHARACTERS_IN_REQUEST_PATH,MALFORMED_RESPONSE,INCORRECT_ASSERTION,CONNREFUSED,CONNRESET,DNS,HOSTUNREACH,NETUNREACH,TIMEOUT,SSL,OCSP,INVALID_TEST,TUNNEL,WEBSOCKET,UNKNOWN,INTERNAL_ERROR

message

string

The API test error message.

httpStatusCode

int64

The API test HTTP status code.

requestHeaders

object

Request header object used for the API test.

<any-key>

object

Requested request header.

responseBody

string

Response body returned for the API test.

responseHeaders

object

Response headers returned for the API test.

<any-key>

Returned request header.

responseSize

int64

Global size in byte of the API test response.

timings

object

Object containing all metrics and their values collected for a Synthetic API test. See the Synthetic Monitoring Metrics documentation.

dns

double

The duration in millisecond of the DNS lookup.

download

double

The time in millisecond to download the response.

firstByte

double

The time in millisecond to first byte.

handshake

double

The duration in millisecond of the TLS handshake.

redirect

double

The time in millisecond spent during redirections.

ssl

double

The duration in millisecond of the TLS handshake.

tcp

double

Time in millisecond to establish the TCP connection.

total

double

The overall time in millisecond the request took to be processed.

wait

double

Time spent in millisecond waiting for a response.

result_id

string

ID of the API test result.

status

enum

The status of your Synthetic monitor.

  • O for not triggered
  • 1 for triggered
  • 2 for no data Allowed enum values: 0,1,2
{
  "check": {
    "config": {
      "assertions": [
        {
          "operator": "contains",
          "property": "string",
          "target": 123456,
          "timingsScope": "string",
          "type": "statusCode"
        }
      ],
      "configVariables": [
        {
          "example": "string",
          "id": "string",
          "name": "VARIABLE_NAME",
          "pattern": "string",
          "secure": false,
          "type": "text"
        }
      ],
      "request": {
        "allow_insecure": false,
        "basicAuth": {
          "password": "PaSSw0RD!",
          "type": "web",
          "username": "my_username"
        },
        "body": "string",
        "bodyType": "text/plain",
        "callType": "unary",
        "certificate": {
          "cert": {
            "content": "string",
            "filename": "string",
            "updatedAt": "string"
          },
          "key": {
            "content": "string",
            "filename": "string",
            "updatedAt": "string"
          }
        },
        "certificateDomains": [],
        "compressedJsonDescriptor": "string",
        "compressedProtoFile": "string",
        "dnsServer": "string",
        "dnsServerPort": "string",
        "files": [
          {
            "bucketKey": "string",
            "content": "string",
            "name": "string",
            "originalFileName": "string",
            "size": "integer",
            "type": "string"
          }
        ],
        "follow_redirects": false,
        "headers": {
          "<any-key>": "string"
        },
        "host": "string",
        "httpVersion": "string",
        "message": "string",
        "metadata": {
          "<any-key>": "string"
        },
        "method": "string",
        "noSavingResponseBody": false,
        "numberOfPackets": "integer",
        "persistCookies": false,
        "port": {
          "description": "undefined",
          "format": "undefined",
          "type": "undefined"
        },
        "proxy": {
          "headers": {
            "<any-key>": "string"
          },
          "url": "https://example.com"
        },
        "query": {},
        "servername": "string",
        "service": "Greeter",
        "shouldTrackHops": false,
        "timeout": "number",
        "url": "https://example.com"
      },
      "variables": [
        {
          "example": "string",
          "id": "string",
          "name": "VARIABLE_NAME",
          "pattern": "string",
          "secure": false,
          "type": "text"
        }
      ]
    }
  },
  "check_time": "number",
  "check_version": "integer",
  "probe_dc": "string",
  "result": {
    "cert": {
      "cipher": "string",
      "exponent": "number",
      "extKeyUsage": [],
      "fingerprint": "string",
      "fingerprint256": "string",
      "issuer": {
        "C": "string",
        "CN": "string",
        "L": "string",
        "O": "string",
        "OU": "string",
        "ST": "string"
      },
      "modulus": "string",
      "protocol": "string",
      "serialNumber": "string",
      "subject": {
        "C": "string",
        "CN": "string",
        "L": "string",
        "O": "string",
        "OU": "string",
        "ST": "string",
        "altName": "string"
      },
      "validFrom": "2019-09-19T10:00:00.000Z",
      "validTo": "2019-09-19T10:00:00.000Z"
    },
    "eventType": "string",
    "failure": {
      "code": "string",
      "message": "Error during DNS resolution (ENOTFOUND)."
    },
    "httpStatusCode": "integer",
    "requestHeaders": {
      "<any-key>": {}
    },
    "responseBody": "string",
    "responseHeaders": {
      "<any-key>": "undefined"
    },
    "responseSize": "integer",
    "timings": {
      "dns": "number",
      "download": "number",
      "firstByte": "number",
      "handshake": "number",
      "redirect": "number",
      "ssl": "number",
      "tcp": "number",
      "total": "number",
      "wait": "number"
    }
  },
  "result_id": "string",
  "status": "integer"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test or result is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

test_id = '<SYNTHETICS_TEST_PUBLIC_ID>'
result_id = '<TEST_RESULT_ID>'


dog = Dogapi::Client.new(api_key, app_key)

dog.get_synthetics_result('test_id'  => test_id , 'result_id'  => result_id)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}https://api.datadoghq.eu/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}https://api.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}https://api.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}

Información general

Obtén un resultado completo específico de un test de navegador Synthetic determinado. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the browser test to which the target result belongs.

result_id [required]

string

The ID of the result to get.

Respuesta

OK

Object returned describing a browser test result.

Expand All

Campo

Tipo

Descripción

check

object

Object describing the browser test configuration.

config [required]

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

check_time

double

When the browser test was conducted.

check_version

int64

Version of the browser test used.

probe_dc

string

Location from which the browser test was performed.

result

object

Object containing results for your Synthetic browser test.

browserType

string

Type of browser device used for the browser test.

browserVersion

string

Browser version used for the browser test.

device

object

Object describing the device used to perform the Synthetic test.

height [required]

int64

Screen height of the device.

id [required]

string

The device ID.

isMobile

boolean

Whether or not the device is a mobile.

name [required]

string

The device name.

width [required]

int64

Screen width of the device.

duration

double

Global duration in second of the browser test.

error

string

Error returned for the browser test.

failure

object

The browser test failure details.

code

enum

Error code that can be returned by a Synthetic test. Allowed enum values: API_REQUEST_FAILURE,ASSERTION_FAILURE,DOWNLOAD_FILE_TOO_LARGE,ELEMENT_NOT_INTERACTABLE,EMAIL_VARIABLE_NOT_DEFINED,EVALUATE_JAVASCRIPT,EVALUATE_JAVASCRIPT_CONTEXT,EXTRACT_VARIABLE,FORBIDDEN_URL,FRAME_DETACHED,INCONSISTENCIES,INTERNAL_ERROR,INVALID_TYPE_TEXT_DELAY,INVALID_URL,INVALID_VARIABLE_PATTERN,INVISIBLE_ELEMENT,LOCATE_ELEMENT,NAVIGATE_TO_LINK,OPEN_URL,PRESS_KEY,SERVER_CERTIFICATE,SELECT_OPTION,STEP_TIMEOUT,SUB_TEST_NOT_PASSED,TEST_TIMEOUT,TOO_MANY_HTTP_REQUESTS,UNAVAILABLE_BROWSER,UNKNOWN,UNSUPPORTED_AUTH_SCHEMA,UPLOAD_FILES_ELEMENT_TYPE,UPLOAD_FILES_DIALOG,UPLOAD_FILES_DYNAMIC_ELEMENT,UPLOAD_FILES_NAME

message

string

The browser test error message.

passed

boolean

Whether or not the browser test was conducted.

receivedEmailCount

int64

The amount of email received during the browser test.

startUrl

string

Starting URL for the browser test.

stepDetails

[object]

Array containing the different browser test steps.

allowFailure

boolean

Whether or not the step was allowed to fail.

browserErrors

[object]

Array of errors collected for a browser test.

description [required]

string

Description of the error.

name [required]

string

Name of the error.

status

int64

Status Code of the error.

type [required]

enum

Error type returned by a browser test. Allowed enum values: network,js

checkType

enum

Type of assertion to apply in an API test. Allowed enum values: equals,notEquals,contains,notContains,startsWith,notStartsWith,greater,lower,greaterEquals,lowerEquals,matchRegex,between,isEmpty,notIsEmpty

description

string

Description of the test.

duration

double

Total duration in millisecond of the test.

error

string

Error returned by the test.

failure

object

The browser test failure details.

code

enum

Error code that can be returned by a Synthetic test. Allowed enum values: API_REQUEST_FAILURE,ASSERTION_FAILURE,DOWNLOAD_FILE_TOO_LARGE,ELEMENT_NOT_INTERACTABLE,EMAIL_VARIABLE_NOT_DEFINED,EVALUATE_JAVASCRIPT,EVALUATE_JAVASCRIPT_CONTEXT,EXTRACT_VARIABLE,FORBIDDEN_URL,FRAME_DETACHED,INCONSISTENCIES,INTERNAL_ERROR,INVALID_TYPE_TEXT_DELAY,INVALID_URL,INVALID_VARIABLE_PATTERN,INVISIBLE_ELEMENT,LOCATE_ELEMENT,NAVIGATE_TO_LINK,OPEN_URL,PRESS_KEY,SERVER_CERTIFICATE,SELECT_OPTION,STEP_TIMEOUT,SUB_TEST_NOT_PASSED,TEST_TIMEOUT,TOO_MANY_HTTP_REQUESTS,UNAVAILABLE_BROWSER,UNKNOWN,UNSUPPORTED_AUTH_SCHEMA,UPLOAD_FILES_ELEMENT_TYPE,UPLOAD_FILES_DIALOG,UPLOAD_FILES_DYNAMIC_ELEMENT,UPLOAD_FILES_NAME

message

string

The browser test error message.

playingTab

enum

Navigate between different tabs for your browser test. Allowed enum values: -1,0,1,2,3

screenshotBucketKey

boolean

Whether or not screenshots where collected by the test.

skipped

boolean

Whether or not to skip this step.

snapshotBucketKey

boolean

Whether or not snapshots where collected by the test.

stepId

int64

The step ID.

subTestStepDetails

[object]

If this step includes a sub-test. Subtests documentation.

timeToInteractive

double

Time before starting the step.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

url

string

URL to perform the step against.

value

Value for the step.

vitalsMetrics

[object]

Array of Core Web Vitals metrics for the step.

cls

double

Cumulative Layout Shift.

lcp

double

Largest Contentful Paint in milliseconds.

url

string

URL attached to the metrics.

warnings

[object]

Warning collected that didn't failed the step.

message [required]

string

Message for the warning.

type [required]

enum

User locator used. Allowed enum values: user_locator

thumbnailsBucketKey

boolean

Whether or not a thumbnail is associated with the browser test.

timeToInteractive

double

Time in second to wait before the browser test starts after reaching the start URL.

result_id

string

ID of the browser test result.

status

enum

The status of your Synthetic monitor.

  • O for not triggered
  • 1 for triggered
  • 2 for no data Allowed enum values: 0,1,2
{
  "check": {
    "config": {
      "assertions": [
        {
          "operator": "contains",
          "property": "string",
          "target": 123456,
          "timingsScope": "string",
          "type": "statusCode"
        }
      ],
      "configVariables": [
        {
          "example": "string",
          "id": "string",
          "name": "VARIABLE_NAME",
          "pattern": "string",
          "secure": false,
          "type": "text"
        }
      ],
      "request": {
        "allow_insecure": false,
        "basicAuth": {
          "password": "PaSSw0RD!",
          "type": "web",
          "username": "my_username"
        },
        "body": "string",
        "bodyType": "text/plain",
        "callType": "unary",
        "certificate": {
          "cert": {
            "content": "string",
            "filename": "string",
            "updatedAt": "string"
          },
          "key": {
            "content": "string",
            "filename": "string",
            "updatedAt": "string"
          }
        },
        "certificateDomains": [],
        "compressedJsonDescriptor": "string",
        "compressedProtoFile": "string",
        "dnsServer": "string",
        "dnsServerPort": "string",
        "files": [
          {
            "bucketKey": "string",
            "content": "string",
            "name": "string",
            "originalFileName": "string",
            "size": "integer",
            "type": "string"
          }
        ],
        "follow_redirects": false,
        "headers": {
          "<any-key>": "string"
        },
        "host": "string",
        "httpVersion": "string",
        "message": "string",
        "metadata": {
          "<any-key>": "string"
        },
        "method": "string",
        "noSavingResponseBody": false,
        "numberOfPackets": "integer",
        "persistCookies": false,
        "port": {
          "description": "undefined",
          "format": "undefined",
          "type": "undefined"
        },
        "proxy": {
          "headers": {
            "<any-key>": "string"
          },
          "url": "https://example.com"
        },
        "query": {},
        "servername": "string",
        "service": "Greeter",
        "shouldTrackHops": false,
        "timeout": "number",
        "url": "https://example.com"
      },
      "variables": [
        {
          "example": "string",
          "id": "string",
          "name": "VARIABLE_NAME",
          "pattern": "string",
          "secure": false,
          "type": "text"
        }
      ]
    }
  },
  "check_time": "number",
  "check_version": "integer",
  "probe_dc": "string",
  "result": {
    "browserType": "string",
    "browserVersion": "string",
    "device": {
      "height": 0,
      "id": "chrome.laptop_large",
      "isMobile": false,
      "name": "",
      "width": 0
    },
    "duration": "number",
    "error": "string",
    "failure": {
      "code": "string",
      "message": "Error during DNS resolution (ENOTFOUND)."
    },
    "passed": false,
    "receivedEmailCount": "integer",
    "startUrl": "string",
    "stepDetails": [
      {
        "allowFailure": false,
        "browserErrors": [
          {
            "description": "Example error message",
            "name": "Failed test",
            "status": 500,
            "type": "network"
          }
        ],
        "checkType": "string",
        "description": "string",
        "duration": "number",
        "error": "string",
        "failure": {
          "code": "string",
          "message": "Error during DNS resolution (ENOTFOUND)."
        },
        "playingTab": "integer",
        "screenshotBucketKey": false,
        "skipped": false,
        "snapshotBucketKey": false,
        "stepId": "integer",
        "subTestStepDetails": [],
        "timeToInteractive": "number",
        "type": "assertElementContent",
        "url": "string",
        "value": "undefined",
        "vitalsMetrics": [
          {
            "cls": "number",
            "lcp": "number",
            "url": "string"
          }
        ],
        "warnings": [
          {
            "message": "",
            "type": "user_locator"
          }
        ]
      }
    ],
    "thumbnailsBucketKey": false,
    "timeToInteractive": "number"
  },
  "result_id": "string",
  "status": "integer"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test or result is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/${public_id}/results/${result_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}/resultshttps://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}/resultshttps://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}/resultshttps://api.datadoghq.com/api/v1/synthetics/tests/{public_id}/resultshttps://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}/resultshttps://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}/results

Información general

Obtén los últimos 150 resúmenes de los resultados de un determinado test de API Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test for which to search results for.

Cadenas de consulta

Nombre

Tipo

Descripción

from_ts

integer

Timestamp in milliseconds from which to start querying results.

to_ts

integer

Timestamp in milliseconds up to which to query results.

probe_dc

array

Locations for which to query results.

Respuesta

OK

Object with the latest Synthetic API test run.

Expand All

Campo

Tipo

Descripción

last_timestamp_fetched

int64

Timestamp of the latest API test run.

results

[object]

Result of the latest API test run.

check_time

double

Last time the API test was performed.

probe_dc

string

Location from which the API test was performed.

result

object

Result of the last API test run.

passed

boolean

Describes if the test run has passed or failed.

timings

object

Object containing all metrics and their values collected for a Synthetic API test. See the Synthetic Monitoring Metrics documentation.

dns

double

The duration in millisecond of the DNS lookup.

download

double

The time in millisecond to download the response.

firstByte

double

The time in millisecond to first byte.

handshake

double

The duration in millisecond of the TLS handshake.

redirect

double

The time in millisecond spent during redirections.

ssl

double

The duration in millisecond of the TLS handshake.

tcp

double

Time in millisecond to establish the TCP connection.

total

double

The overall time in millisecond the request took to be processed.

wait

double

Time spent in millisecond waiting for a response.

result_id

string

ID of the API test result.

status

enum

The status of your Synthetic monitor.

  • O for not triggered
  • 1 for triggered
  • 2 for no data Allowed enum values: 0,1,2
{
  "last_timestamp_fetched": "integer",
  "results": [
    {
      "check_time": "number",
      "probe_dc": "string",
      "result": {
        "passed": false,
        "timings": {
          "dns": "number",
          "download": "number",
          "firstByte": "number",
          "handshake": "number",
          "redirect": "number",
          "ssl": "number",
          "tcp": "number",
          "total": "number",
          "wait": "number"
        }
      },
      "result_id": "string",
      "status": "integer"
    }
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

test_id = '<SYNTHETICS_TEST_PUBLIC_ID>'

dog = Dogapi::Client.new(api_key, app_key)

dog.get_synthetics_results('test_id'  => test_id)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/resultshttps://api.datadoghq.eu/api/v1/synthetics/tests/browser/{public_id}/resultshttps://api.ddog-gov.com/api/v1/synthetics/tests/browser/{public_id}/resultshttps://api.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/resultshttps://api.us3.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/resultshttps://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/{public_id}/results

Información general

Obtén los últimos 150 resúmenes de los resultados de un determinado test de navegador Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the browser test for which to search results for.

Cadenas de consulta

Nombre

Tipo

Descripción

from_ts

integer

Timestamp in milliseconds from which to start querying results.

to_ts

integer

Timestamp in milliseconds up to which to query results.

probe_dc

array

Locations for which to query results.

Respuesta

OK

Object with the latest Synthetic browser test run.

Expand All

Campo

Tipo

Descripción

last_timestamp_fetched

int64

Timestamp of the latest browser test run.

results

[object]

Result of the latest browser test run.

check_time

double

Last time the browser test was performed.

probe_dc

string

Location from which the Browser test was performed.

result

object

Object with the result of the last browser test run.

device

object

Object describing the device used to perform the Synthetic test.

height [required]

int64

Screen height of the device.

id [required]

string

The device ID.

isMobile

boolean

Whether or not the device is a mobile.

name [required]

string

The device name.

width [required]

int64

Screen width of the device.

duration

double

Length in milliseconds of the browser test run.

errorCount

int64

Amount of errors collected for a single browser test run.

stepCountCompleted

int64

Amount of browser test steps completed before failing.

stepCountTotal

int64

Total amount of browser test steps.

result_id

string

ID of the browser test result.

status

enum

The status of your Synthetic monitor.

  • O for not triggered
  • 1 for triggered
  • 2 for no data Allowed enum values: 0,1,2
{
  "last_timestamp_fetched": "integer",
  "results": [
    {
      "check_time": "number",
      "probe_dc": "string",
      "result": {
        "device": {
          "height": 0,
          "id": "chrome.laptop_large",
          "isMobile": false,
          "name": "",
          "width": 0
        },
        "duration": "number",
        "errorCount": "integer",
        "stepCountCompleted": "integer",
        "stepCountTotal": "integer"
      },
      "result_id": "string",
      "status": "integer"
    }
  ]
}

forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic Monitoring is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/browser/${public_id}/results" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/ci/batch/{batch_id}https://api.datadoghq.eu/api/v1/synthetics/ci/batch/{batch_id}https://api.ddog-gov.com/api/v1/synthetics/ci/batch/{batch_id}https://api.datadoghq.com/api/v1/synthetics/ci/batch/{batch_id}https://api.us3.datadoghq.com/api/v1/synthetics/ci/batch/{batch_id}https://api.us5.datadoghq.com/api/v1/synthetics/ci/batch/{batch_id}

Información general

Obtén los datos actualizados de un lote. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

batch_id [required]

string

The ID of the batch.

Respuesta

OK

Details about a batch response.

Expand All

Campo

Tipo

Descripción

data

object

Wrapper object that contains the details of a batch.

metadata

object

Metadata for the Synthetic tests run.

ci

object

Description of the CI provider.

pipeline

object

Description of the CI pipeline.

url

string

URL of the pipeline.

provider

object

Description of the CI provider.

name

string

Name of the CI provider.

git

object

Git information.

branch

string

Branch name.

commitSha

string

The commit SHA.

results

[object]

List of results for the batch.

device

string

The device ID.

duration

double

Total duration in millisecond of the test.

execution_rule

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

location

string

Name of the location.

result_id

string

The ID of the result to get.

retries

double

Number of times this result has been retried.

status

enum

Determines whether the batch has passed, failed, or is in progress. Allowed enum values: passed,skipped,failed

test_name

string

Name of the test.

test_public_id

string

The public ID of the Synthetic test.

test_type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

status

enum

Determines whether the batch has passed, failed, or is in progress. Allowed enum values: passed,skipped,failed

{
  "data": {
    "metadata": {
      "ci": {
        "pipeline": {
          "url": "string"
        },
        "provider": {
          "name": "string"
        }
      },
      "git": {
        "branch": "string",
        "commitSha": "string"
      }
    },
    "results": [
      {
        "device": "chrome.laptop_large",
        "duration": "number",
        "execution_rule": "blocking",
        "location": "string",
        "result_id": "string",
        "retries": "number",
        "status": "string",
        "test_name": "string",
        "test_public_id": "string",
        "test_type": "string"
      }
    ],
    "status": "string"
  }
}

Batch does not exist.

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export batch_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/ci/batch/${batch_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/deletehttps://api.datadoghq.eu/api/v1/synthetics/tests/deletehttps://api.ddog-gov.com/api/v1/synthetics/tests/deletehttps://api.datadoghq.com/api/v1/synthetics/tests/deletehttps://api.us3.datadoghq.com/api/v1/synthetics/tests/deletehttps://api.us5.datadoghq.com/api/v1/synthetics/tests/delete

Información general

Eliminar varios tests Synthetic por ID. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Lista de ID públicos de los tests Synthetic a eliminar.

Expand All

Campo

Tipo

Descripción

force_delete_dependencies

boolean

Delete the Synthetic test even if it's referenced by other resources (for example, SLOs and composite monitors).

public_ids

[string]

An array of Synthetic test IDs you want to delete.

{
  "force_delete_dependencies": false,
  "public_ids": [
    []
  ]
}

Respuesta

OK.

Response object for deleting Synthetic tests.

Expand All

Campo

Tipo

Descripción

deleted_tests

[object]

Array of objects containing a deleted Synthetic test ID with the associated deletion timestamp.

deleted_at

date-time

Deletion timestamp of the Synthetic test ID.

public_id

string

The Synthetic test ID deleted.

{
  "deleted_tests": [
    {
      "deleted_at": "2019-09-19T10:00:00.000Z",
      "public_id": "string"
    }
  ]
}

- JSON format is wrong - Test cannot be deleted as it's used elsewhere (as a sub-test or in an uptime widget) - Some IDs are not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Tests to be deleted can't be found - Synthetic is not activated for the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

test_ids = ['<SYNTHETICS_TEST_PUBLIC_ID_1>','<SYNTHETICS_TEST_PUBLIC_ID_2>']

dog.delete_synthetics_tests('test_ids' => test_ids)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/variableshttps://api.datadoghq.eu/api/v1/synthetics/variableshttps://api.ddog-gov.com/api/v1/synthetics/variableshttps://api.datadoghq.com/api/v1/synthetics/variableshttps://api.us3.datadoghq.com/api/v1/synthetics/variableshttps://api.us5.datadoghq.com/api/v1/synthetics/variables

Información general

Obtén la lista de todas las variables globales Synthetic. This endpoint requires the synthetics_global_variable_read permission.

OAuth apps require the synthetics_global_variable_read authorization scope to access this endpoint.

Respuesta

OK

Object containing an array of Synthetic global variables.

Expand All

Campo

Tipo

Descripción

variables

[object]

Array of Synthetic global variables.

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value [required]

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "variables": [
    {
      "attributes": {
        "restricted_roles": [
          "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        ]
      },
      "description": "Example description",
      "id": "string",
      "is_fido": false,
      "is_totp": false,
      "name": "MY_VARIABLE",
      "parse_test_options": {
        "field": "content-type",
        "localVariableName": "LOCAL_VARIABLE",
        "parser": {
          "type": "raw",
          "value": "string"
        },
        "type": "http_body"
      },
      "parse_test_public_id": "abc-def-123",
      "tags": [
        "team:front",
        "test:workflow-1"
      ],
      "value": {
        "options": {
          "totp_parameters": {
            "digits": 6,
            "refresh_interval": 30
          }
        },
        "secure": false,
        "value": "example-value"
      }
    }
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v1/synthetics/variableshttps://api.datadoghq.eu/api/v1/synthetics/variableshttps://api.ddog-gov.com/api/v1/synthetics/variableshttps://api.datadoghq.com/api/v1/synthetics/variableshttps://api.us3.datadoghq.com/api/v1/synthetics/variableshttps://api.us5.datadoghq.com/api/v1/synthetics/variables

Información general

Crea una variable global Synthetic. This endpoint requires the synthetics_global_variable_write permission.

OAuth apps require the synthetics_global_variable_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles de la variable global a crear.

Expand All

Campo

Tipo

Descripción

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "description": "",
  "is_fido": true,
  "name": "GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC",
  "tags": []
}
{
  "description": "",
  "is_totp": true,
  "name": "GLOBAL_VARIABLE_TOTP_PAYLOAD_EXAMPLESYNTHETIC",
  "tags": [],
  "value": {
    "secure": false,
    "value": "",
    "options": {
      "totp_parameters": {
        "digits": 6,
        "refresh_interval": 30
      }
    }
  }
}
{
  "description": "",
  "name": "GLOBAL_VARIABLE_FROM_TEST_PAYLOAD_EXAMPLESYNTHETIC",
  "tags": [],
  "value": {
    "secure": false,
    "value": ""
  },
  "parse_test_public_id": "123-abc-456",
  "parse_test_options": {
    "type": "local_variable",
    "localVariableName": "EXTRACTED_VALUE"
  }
}

Respuesta

OK

Synthetic global variable.

Expand All

Campo

Tipo

Descripción

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value [required]

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "attributes": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "description": "Example description",
  "id": "string",
  "is_fido": false,
  "is_totp": false,
  "name": "MY_VARIABLE",
  "parse_test_options": {
    "field": "content-type",
    "localVariableName": "LOCAL_VARIABLE",
    "parser": {
      "type": "raw",
      "value": "string"
    },
    "type": "http_body"
  },
  "parse_test_public_id": "abc-def-123",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "options": {
      "totp_parameters": {
        "digits": 6,
        "refresh_interval": 30
      }
    },
    "secure": false,
    "value": "example-value"
  }
}

Invalid request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Conflict

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "", "is_fido": true, "name": "GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC", "tags": [] } EOF
                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "", "is_totp": true, "name": "GLOBAL_VARIABLE_TOTP_PAYLOAD_EXAMPLESYNTHETIC", "tags": [], "value": { "secure": false, "value": "", "options": { "totp_parameters": { "digits": 6, "refresh_interval": 30 } } } } EOF
                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "", "name": "GLOBAL_VARIABLE_FROM_TEST_PAYLOAD_EXAMPLESYNTHETIC", "tags": [], "value": { "secure": false, "value": "" }, "parse_test_public_id": "123-abc-456", "parse_test_options": { "type": "local_variable", "localVariableName": "EXTRACTED_VALUE" } } EOF

GET https://api.ap1.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.eu/api/v1/synthetics/variables/{variable_id}https://api.ddog-gov.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us3.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us5.datadoghq.com/api/v1/synthetics/variables/{variable_id}

Información general

Obtén la configuración detallada de una variable global.

OAuth apps require the synthetics_global_variable_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

variable_id [required]

string

The ID of the global variable.

Respuesta

OK

Synthetic global variable.

Expand All

Campo

Tipo

Descripción

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value [required]

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "attributes": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "description": "Example description",
  "id": "string",
  "is_fido": false,
  "is_totp": false,
  "name": "MY_VARIABLE",
  "parse_test_options": {
    "field": "content-type",
    "localVariableName": "LOCAL_VARIABLE",
    "parser": {
      "type": "raw",
      "value": "string"
    },
    "type": "http_body"
  },
  "parse_test_public_id": "abc-def-123",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "options": {
      "totp_parameters": {
        "digits": 6,
        "refresh_interval": 30
      }
    },
    "secure": false,
    "value": "example-value"
  }
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export variable_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables/${variable_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.eu/api/v1/synthetics/variables/{variable_id}https://api.ddog-gov.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us3.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us5.datadoghq.com/api/v1/synthetics/variables/{variable_id}

Información general

Modifica una variable global Synthetic. This endpoint requires the synthetics_global_variable_write permission.

OAuth apps require the synthetics_global_variable_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

variable_id [required]

string

The ID of the global variable.

Solicitud

Body Data (required)

Detalles de la variable global a actualizar.

Expand All

Campo

Tipo

Descripción

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "attributes": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "description": "Example description",
  "is_fido": false,
  "is_totp": false,
  "name": "MY_VARIABLE",
  "parse_test_options": {
    "field": "content-type",
    "localVariableName": "LOCAL_VARIABLE",
    "parser": {
      "type": "raw",
      "value": "string"
    },
    "type": "http_body"
  },
  "parse_test_public_id": "abc-def-123",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "options": {
      "totp_parameters": {
        "digits": 6,
        "refresh_interval": 30
      }
    },
    "secure": false,
    "value": "example-value"
  }
}

Respuesta

OK

Synthetic global variable.

Expand All

Campo

Tipo

Descripción

attributes

object

Attributes of the global variable.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

description [required]

string

Description of the global variable.

id

string

Unique identifier of the global variable.

is_fido

boolean

Determines if the global variable is a FIDO variable.

is_totp

boolean

Determines if the global variable is a TOTP/MFA variable.

name [required]

string

Name of the global variable. Unique across Synthetic global variables.

parse_test_options

object

Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with parse_test_public_id.

field

string

When type is http_header, name of the header to use to extract the value.

localVariableName

string

When type is local_variable, name of the local variable to use to extract the value.

parser

object

Details of the parser to use for the global variable.

type [required]

enum

Type of parser for a Synthetic global variable from a synthetics test. Allowed enum values: raw,json_path,regex,x_path

value

string

Regex or JSON path used for the parser. Not used with type raw.

type [required]

enum

Type of value to extract from a test for a Synthetic global variable. Allowed enum values: http_body,http_header,http_status_code,local_variable

parse_test_public_id

string

A Synthetic test ID to use as a test to generate the variable value.

tags [required]

[string]

Tags of the global variable.

value [required]

object

Value of the global variable.

options

object

Options for the Global Variable for MFA.

totp_parameters

object

Parameters for the TOTP/MFA variable

digits

int32

Number of digits for the OTP code.

refresh_interval

int32

Interval for which to refresh the token (in seconds).

secure

boolean

Determines if the value of the variable is hidden.

value

string

Value of the global variable. When reading a global variable, the value will not be present if the variable is hidden with the secure property.

{
  "attributes": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "description": "Example description",
  "id": "string",
  "is_fido": false,
  "is_totp": false,
  "name": "MY_VARIABLE",
  "parse_test_options": {
    "field": "content-type",
    "localVariableName": "LOCAL_VARIABLE",
    "parser": {
      "type": "raw",
      "value": "string"
    },
    "type": "http_body"
  },
  "parse_test_public_id": "abc-def-123",
  "tags": [
    "team:front",
    "test:workflow-1"
  ],
  "value": {
    "options": {
      "totp_parameters": {
        "digits": 6,
        "refresh_interval": 30
      }
    },
    "secure": false,
    "value": "example-value"
  }
}

Invalid request

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export variable_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables/${variable_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": { "parser": { "type": "raw" }, "type": "http_body" }, "tags": [ "team:front", "test:workflow-1" ] } EOF

DELETE https://api.ap1.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.eu/api/v1/synthetics/variables/{variable_id}https://api.ddog-gov.com/api/v1/synthetics/variables/{variable_id}https://api.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us3.datadoghq.com/api/v1/synthetics/variables/{variable_id}https://api.us5.datadoghq.com/api/v1/synthetics/variables/{variable_id}

Información general

Elimina una variable global Synthetic. This endpoint requires the synthetics_global_variable_write permission.

OAuth apps require the synthetics_global_variable_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

variable_id [required]

string

The ID of the global variable.

Respuesta

OK

JSON format is wrong

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export variable_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/variables/${variable_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v1/synthetics/private-locationshttps://api.datadoghq.eu/api/v1/synthetics/private-locationshttps://api.ddog-gov.com/api/v1/synthetics/private-locationshttps://api.datadoghq.com/api/v1/synthetics/private-locationshttps://api.us3.datadoghq.com/api/v1/synthetics/private-locationshttps://api.us5.datadoghq.com/api/v1/synthetics/private-locations

Información general

Crea una nueva localización Synthetic privada. This endpoint requires the synthetics_private_location_write permission.

OAuth apps require the synthetics_private_location_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles de la localización privada a crear.

Expand All

Campo

Tipo

Descripción

description [required]

string

Description of the private location.

id

string

Unique identifier of the private location.

metadata

object

Object containing metadata about the private location.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

name [required]

string

Name of the private location.

secrets

object

Secrets for the private location. Only present in the response when creating the private location.

authentication

object

Authentication part of the secrets.

id

string

Access key for the private location.

key

string

Secret access key for the private location.

config_decryption

object

Private key for the private location.

key

string

Private key for the private location.

tags [required]

[string]

Array of tags attached to the private location.

{
  "description": "Test Example-Synthetic description",
  "metadata": {
    "restricted_roles": [
      "string"
    ]
  },
  "name": "Example-Synthetic",
  "tags": [
    "test:examplesynthetic"
  ]
}

Respuesta

OK

Object that contains the new private location, the public key for result encryption, and the configuration skeleton.

Expand All

Campo

Tipo

Descripción

config

object

Configuration skeleton for the private location. See installation instructions of the private location on how to use this configuration.

private_location

object

Object containing information about the private location to create.

description [required]

string

Description of the private location.

id

string

Unique identifier of the private location.

metadata

object

Object containing metadata about the private location.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

name [required]

string

Name of the private location.

secrets

object

Secrets for the private location. Only present in the response when creating the private location.

authentication

object

Authentication part of the secrets.

id

string

Access key for the private location.

key

string

Secret access key for the private location.

config_decryption

object

Private key for the private location.

key

string

Private key for the private location.

tags [required]

[string]

Array of tags attached to the private location.

result_encryption

object

Public key for the result encryption.

id

string

Fingerprint for the encryption key.

key

string

Public key for result encryption.

{
  "config": {},
  "private_location": {
    "description": "Description of private location",
    "id": "string",
    "metadata": {
      "restricted_roles": [
        "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      ]
    },
    "name": "New private location",
    "secrets": {
      "authentication": {
        "id": "string",
        "key": "string"
      },
      "config_decryption": {
        "key": "string"
      }
    },
    "tags": [
      "team:front"
    ]
  },
  "result_encryption": {
    "id": "string",
    "key": "string"
  }
}

Quota reached for private locations

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Private locations are not activated for the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/private-locations" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "Test Example-Synthetic description", "metadata": { "restricted_roles": [ "string" ] }, "name": "Example-Synthetic", "tags": [ "test:examplesynthetic" ] } EOF

GET https://api.ap1.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.eu/api/v1/synthetics/private-locations/{location_id}https://api.ddog-gov.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us3.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/{location_id}

Información general

Obtén una localización Synthetic privada. This endpoint requires the synthetics_private_location_read permission.

OAuth apps require the synthetics_private_location_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

location_id [required]

string

The ID of the private location.

Respuesta

OK

Object containing information about the private location to create.

Expand All

Campo

Tipo

Descripción

description [required]

string

Description of the private location.

id

string

Unique identifier of the private location.

metadata

object

Object containing metadata about the private location.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

name [required]

string

Name of the private location.

secrets

object

Secrets for the private location. Only present in the response when creating the private location.

authentication

object

Authentication part of the secrets.

id

string

Access key for the private location.

key

string

Secret access key for the private location.

config_decryption

object

Private key for the private location.

key

string

Private key for the private location.

tags [required]

[string]

Array of tags attached to the private location.

{
  "description": "Description of private location",
  "id": "string",
  "metadata": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "name": "New private location",
  "secrets": {
    "authentication": {
      "id": "string",
      "key": "string"
    },
    "config_decryption": {
      "key": "string"
    }
  },
  "tags": [
    "team:front"
  ]
}

- Synthetic private locations are not activated for the user - Private location does not exist

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export location_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/${location_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.eu/api/v1/synthetics/private-locations/{location_id}https://api.ddog-gov.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us3.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/{location_id}

Información general

Modifica una localización Synthetic privada. This endpoint requires the synthetics_private_location_write permission.

OAuth apps require the synthetics_private_location_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

location_id [required]

string

The ID of the private location.

Solicitud

Body Data (required)

Detalles de la localización privada a actualizar.

Expand All

Campo

Tipo

Descripción

description [required]

string

Description of the private location.

id

string

Unique identifier of the private location.

metadata

object

Object containing metadata about the private location.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

name [required]

string

Name of the private location.

secrets

object

Secrets for the private location. Only present in the response when creating the private location.

authentication

object

Authentication part of the secrets.

id

string

Access key for the private location.

key

string

Secret access key for the private location.

config_decryption

object

Private key for the private location.

key

string

Private key for the private location.

tags [required]

[string]

Array of tags attached to the private location.

{
  "description": "Description of private location",
  "metadata": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "name": "New private location",
  "tags": [
    "team:front"
  ]
}

Respuesta

OK

Object containing information about the private location to create.

Expand All

Campo

Tipo

Descripción

description [required]

string

Description of the private location.

id

string

Unique identifier of the private location.

metadata

object

Object containing metadata about the private location.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

name [required]

string

Name of the private location.

secrets

object

Secrets for the private location. Only present in the response when creating the private location.

authentication

object

Authentication part of the secrets.

id

string

Access key for the private location.

key

string

Secret access key for the private location.

config_decryption

object

Private key for the private location.

key

string

Private key for the private location.

tags [required]

[string]

Array of tags attached to the private location.

{
  "description": "Description of private location",
  "id": "string",
  "metadata": {
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ]
  },
  "name": "New private location",
  "secrets": {
    "authentication": {
      "id": "string",
      "key": "string"
    },
    "config_decryption": {
      "key": "string"
    }
  },
  "tags": [
    "team:front"
  ]
}

- Private locations are not activated for the user - Private location does not exist

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export location_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/${location_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "description": "Description of private location", "name": "New private location", "tags": [ "team:front" ] } EOF

GET https://api.ap1.datadoghq.com/api/v1/synthetics/locationshttps://api.datadoghq.eu/api/v1/synthetics/locationshttps://api.ddog-gov.com/api/v1/synthetics/locationshttps://api.datadoghq.com/api/v1/synthetics/locationshttps://api.us3.datadoghq.com/api/v1/synthetics/locationshttps://api.us5.datadoghq.com/api/v1/synthetics/locations

Información general

Obtén la lista de ubicaciones públicas y privadas disponibles para tests Synthetic. No se requieren argumentos. This endpoint requires the synthetics_private_location_read permission.

OAuth apps require the synthetics_private_location_read authorization scope to access this endpoint.

Respuesta

OK

List of Synthetic locations.

Expand All

Campo

Tipo

Descripción

locations

[object]

List of Synthetic locations.

id

string

Unique identifier of the location.

name

string

Name of the location.

{
  "locations": [
    {
      "id": "string",
      "name": "string"
    }
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/locations" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

DELETE https://api.ap1.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.eu/api/v1/synthetics/private-locations/{location_id}https://api.ddog-gov.com/api/v1/synthetics/private-locations/{location_id}https://api.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us3.datadoghq.com/api/v1/synthetics/private-locations/{location_id}https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/{location_id}

Información general

Elimina una localización Synthetic privada. This endpoint requires the synthetics_private_location_write permission.

OAuth apps require the synthetics_private_location_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

location_id [required]

string

The ID of the private location.

Respuesta

OK

- Private locations are not activated for the user - Private location does not exist

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export location_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/private-locations/${location_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}

Información general

Obtén la configuración detallada, asociada a un test Synthetic. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Respuesta

OK

Object containing details about your Synthetic test.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "creator": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "monitor_id": "integer",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic is not activated for the user - Test is not owned by the user

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

test_id = '<SYNTHETICS_TEST_PUBLIC_ID>'

dog = Dogapi::Client.new(api_key, app_key)

dog.get_synthetics_test('test_id'  => test_id)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"

GET https://api.ap1.datadoghq.com/api/v1/synthetics/settings/default_locationshttps://api.datadoghq.eu/api/v1/synthetics/settings/default_locationshttps://api.ddog-gov.com/api/v1/synthetics/settings/default_locationshttps://api.datadoghq.com/api/v1/synthetics/settings/default_locationshttps://api.us3.datadoghq.com/api/v1/synthetics/settings/default_locationshttps://api.us5.datadoghq.com/api/v1/synthetics/settings/default_locations

Información general

Obtenga la configuración de localizaciones predeterminadas. This endpoint requires the synthetics_default_settings_read permission.

Respuesta

OK

List of Synthetics default locations settings.

Expand All

Campo

Tipo

Descripción

description

Name of the location.

string

[
  "aws:eu-west-3"
]

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/settings/default_locations" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}https://api.ddog-gov.com/api/v1/synthetics/tests/{public_id}https://api.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us3.datadoghq.com/api/v1/synthetics/tests/{public_id}https://api.us5.datadoghq.com/api/v1/synthetics/tests/{public_id}

Información general

Este endpoint está obsoleto. Para modificar un test, utiliza Modificar un test de API o Editar un test de navegador. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

public_id [required]

string

The public ID of the test to get details from.

Solicitud

Body Data (required)

Nuevos detalles del test a guardar.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

Respuesta

OK

Object containing details about your Synthetic test.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "creator": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "monitor_id": "integer",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

- JSON format is wrong - Updating sub-type is forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

- Synthetic is not activated for the user - Test is not owned by the user - Test can't be found

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Path parameters
export public_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/${public_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "configVariables": [ { "name": "VARIABLE_NAME", "type": "text" } ], "request": { "proxy": { "url": "https://example.com" } }, "variables": [ { "name": "VARIABLE_NAME", "type": "text" } ] }, "options": { "ci": { "executionRule": "blocking" }, "rumSettings": { "isEnabled": true }, "scheduling": { "timeframes": [ { "day": 1, "from": "07:00", "to": "16:00" } ], "timezone": "America/New_York" } } } EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.datadoghq.eu/api/v1/synthetics/tests/uptimeshttps://api.ddog-gov.com/api/v1/synthetics/tests/uptimeshttps://api.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.us3.datadoghq.com/api/v1/synthetics/tests/uptimeshttps://api.us5.datadoghq.com/api/v1/synthetics/tests/uptimes

Información general

Obtén el tiempo de actividad de varios tests Synthetic por ID. This endpoint requires the synthetics_read permission.

OAuth apps require the synthetics_read authorization scope to access this endpoint.

Solicitud

Body Data (required)

Lista de ID públicos de los tests Synthetic y los periodos de tiempo.

Expand All

Campo

Tipo

Descripción

from_ts [required]

int64

Timestamp in seconds (Unix epoch) for the start of uptime.

public_ids [required]

[string]

An array of Synthetic test IDs you want uptimes for.

to_ts [required]

int64

Timestamp in seconds (Unix epoch) for the end of uptime.

{
  "from_ts": 1726041488,
  "public_ids": [
    "p8m-9gw-nte"
  ],
  "to_ts": 1726055954
}

Respuesta

OK.

Expand All

Campo

Tipo

Descripción

from_ts

int64

Timestamp in seconds for the start of uptime.

overall

object

Object containing the uptime information.

errors

[object]

An array of error objects returned while querying the history data for the service level objective.

error_message [required]

string

A message with more details about the error.

error_type [required]

string

Type of the error.

group

string

The location name

history

[array]

The state transition history for the monitor, represented as an array of pairs. Each pair is an array where the first element is the transition timestamp in Unix epoch format (integer) and the second element is the state (integer). For the state, an integer value of 0 indicates uptime, 1 indicates downtime, and 2 indicates no data.

span_precision

double

The number of decimal places to which the SLI value is accurate for the given from-to timestamps.

uptime

double

The overall uptime.

public_id

string

A Synthetic test ID.

to_ts

int64

Timestamp in seconds for the end of uptime.

{
  "from_ts": "integer",
  "overall": {
    "errors": [
      {
        "error_message": "",
        "error_type": ""
      }
    ],
    "group": "name",
    "history": [
      [
        1579212382,
        0
      ]
    ],
    "span_precision": 2,
    "uptime": 99.99
  },
  "public_id": "abc-def-123",
  "to_ts": "integer"
}

- JSON format is wrong

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests/uptimes" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "from_ts": 1726041488, "public_ids": [ "p8m-9gw-nte" ], "to_ts": 1726055954 } EOF

POST https://api.ap1.datadoghq.com/api/v1/synthetics/testshttps://api.datadoghq.eu/api/v1/synthetics/testshttps://api.ddog-gov.com/api/v1/synthetics/testshttps://api.datadoghq.com/api/v1/synthetics/testshttps://api.us3.datadoghq.com/api/v1/synthetics/testshttps://api.us5.datadoghq.com/api/v1/synthetics/tests

Información general

Este endpoint está obsoleto. Para crear un test, utiliza Crear un test de API, o Crear un test de navegador. This endpoint requires the synthetics_write permission.

OAuth apps require the synthetics_write authorization scope to access this endpoint.

Solicitud

Body Data (required)

Detalles del test a crear.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

Respuesta

OK - Returns the created test details.

Object containing details about your Synthetic test.

Expand All

Campo

Tipo

Descripción

config

object

Configuration object for a Synthetic test.

assertions

[ <oneOf>]

Array of assertions used for the test. Required for single API tests.

default:

Option 1

object

An assertion which uses a simple target.

operator [required]

enum

Assertion operator to apply. Allowed enum values: contains,doesNotContain,is,isNot,lessThan,lessThanOrEqual,moreThan,moreThanOrEqual,matches,doesNotMatch,validates,isInMoreThan,isInLessThan,doesNotExist,isUndefined

property

string

The associated assertion property.

target [required]

Value used by the operator.

timingsScope

enum

Timings scope for response time assertions. Allowed enum values: all,withoutDNS

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 2

object

An assertion which targets body hash.

operator [required]

enum

Assertion operator to apply. Allowed enum values: md5,sha1,sha256

target [required]

Value used by the operator.

type [required]

enum

Type of the assertion. Allowed enum values: bodyHash

Option 3

object

An assertion for the validatesJSONPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONPath

property

string

The associated assertion property.

target

object

Composed target for validatesJSONPath operator.

elementsOperator

string

The element from the list of results to assert on. To choose from the first element in the list firstElementMatches, every element in the list everyElementMatches, at least one element in the list atLeastOneElementMatches or the serialized value of the list serializationMatches.

jsonPath

string

The JSON path to assert.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 4

object

An assertion for the validatesJSONSchema operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesJSONSchema

target

object

Composed target for validatesJSONSchema operator.

jsonSchema

string

The JSON Schema to assert.

metaSchema

enum

The JSON Schema meta-schema version used in the assertion. Allowed enum values: draft-07,draft-06

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 5

object

An assertion for the validatesXPath operator.

operator [required]

enum

Assertion operator to apply. Allowed enum values: validatesXPath

property

string

The associated assertion property.

target

object

Composed target for validatesXPath operator.

operator

string

The specific operator to use on the path.

targetValue

The path target value to compare to.

xPath

string

The X path to assert.

type [required]

enum

Type of the assertion. Allowed enum values: body,header,statusCode,certificate,responseTime,property,recordEvery,recordSome,tlsVersion,minTlsVersion,latency,packetLossPercentage,packetsReceived,networkHop,receivedMessage,grpcHealthcheckStatus,grpcMetadata,grpcProto,connection

Option 6

object

A JavaScript assertion.

code [required]

string

The JavaScript code that performs the assertions.

type [required]

enum

Type of the assertion. Allowed enum values: javascript

configVariables

[object]

Array of variables used for the test.

example

string

Example for the variable.

id

string

ID of the variable for global variables.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Whether the value of this variable will be obfuscated in test results. Only for config variables of type text.

type [required]

enum

Type of the configuration variable. Allowed enum values: global,text,email

request

object

Object describing the Synthetic test request.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in a multistep test step.

basicAuth

 <oneOf>

Object to handle basic authentication when performing the test.

Option 1

object

Object to handle basic authentication when performing the test.

password [required]

string

Password to use for the basic authentication.

type

enum

The type of basic authentication to use when performing the test. Allowed enum values: web

default: web

username [required]

string

Username to use for the basic authentication.

Option 2

object

Object to handle SIGV4 authentication when performing the test.

accessKey [required]

string

Access key for the SIGV4 authentication.

region

string

Region for the SIGV4 authentication.

secretKey [required]

string

Secret key for the SIGV4 authentication.

serviceName

string

Service name for the SIGV4 authentication.

sessionToken

string

Session token for the SIGV4 authentication.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: sigv4

default: sigv4

Option 3

object

Object to handle NTLM authentication when performing the test.

domain

string

Domain for the authentication to use when performing the test.

password

string

Password for the authentication to use when performing the test.

type [required]

enum

The type of authentication to use when performing the test. Allowed enum values: ntlm

default: ntlm

username

string

Username for the authentication to use when performing the test.

workstation

string

Workstation for the authentication to use when performing the test.

Option 4

object

Object to handle digest authentication when performing the test.

password [required]

string

Password to use for the digest authentication.

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: digest

default: digest

username [required]

string

Username to use for the digest authentication.

Option 5

object

Object to handle oauth client authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId [required]

string

Client ID to use when performing the authentication.

clientSecret [required]

string

Client secret to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-client

default: oauth-client

Option 6

object

Object to handle oauth rop authentication when performing the test.

accessTokenUrl [required]

string

Access token URL to use when performing the authentication.

audience

string

Audience to use when performing the authentication.

clientId

string

Client ID to use when performing the authentication.

clientSecret

string

Client secret to use when performing the authentication.

password [required]

string

Password to use when performing the authentication.

resource

string

Resource to use when performing the authentication.

scope

string

Scope to use when performing the authentication.

tokenApiAuthentication [required]

enum

Type of token to use when performing the authentication. Allowed enum values: header,body

type [required]

enum

The type of basic authentication to use when performing the test. Allowed enum values: oauth-rop

default: oauth-rop

username [required]

string

Username to use when performing the authentication.

body

string

Body to include in the test.

bodyType

enum

Type of the request body. Allowed enum values: text/plain,application/json,text/xml,text/html,application/x-www-form-urlencoded,graphql,application/octet-stream,multipart/form-data

callType

enum

The type of gRPC call to perform. Allowed enum values: healthcheck,unary

certificate

object

Client certificate to use when performing the test request.

cert

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

key

object

Define a request certificate.

content

string

Content of the certificate or key.

filename

string

File name for the certificate or key.

updatedAt

string

Date of update of the certificate or key, ISO format.

certificateDomains

[string]

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.

default:

compressedJsonDescriptor

string

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.

compressedProtoFile

string

A protobuf file that needs to be gzipped first then base64 encoded.

dnsServer

string

DNS server to use for DNS tests.

dnsServerPort

string

DNS server port to use for DNS tests.

files

[object]

Files to be used as part of the request in the test.

bucketKey

string

Bucket key of the file.

content

string

Content of the file.

name

string

Name of the file.

originalFileName

string

Original name of the file.

size

int64

Size of the file.

type

string

Type of the file.

follow_redirects

boolean

Specifies whether or not the request follows redirects.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

host

string

Host name to perform the test with.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

message

string

Message to send for UDP or WebSocket tests.

metadata

object

Metadata to include when performing the gRPC test.

<any-key>

string

A single metadatum.

method

string

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.

noSavingResponseBody

boolean

Determines whether or not to save the response body.

numberOfPackets

int32

Number of pings to use per test.

persistCookies

boolean

Persist cookies across redirects.

port

 <oneOf>

Port to use when performing the test.

Option 1

int64

Integer Port number to use when performing the test.

Option 2

string

String Port number to use when performing the test. Supports templated variables.

proxy

object

The proxy to perform the test.

headers

object

Headers to include when performing the test.

<any-key>

string

A single Header.

url [required]

string

URL of the proxy to perform the test.

query

object

Query to use for the test.

servername

string

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.

service

string

The gRPC service on which you want to perform the gRPC call.

shouldTrackHops

boolean

Turns on a traceroute probe to discover all gateways along the path to the host destination.

timeout

double

Timeout in seconds for the test.

url

string

URL to perform the test with.

variables

[object]

Browser tests only - array of variables used for the test steps.

example

string

Example for the variable.

id

string

ID for the variable. Global variables require an ID.

name [required]

string

Name of the variable.

pattern

string

Pattern of the variable.

secure

boolean

Determines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.

type [required]

enum

Type of browser test variable. Allowed enum values: element,email,global,text

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

locations

[string]

Array of locations used to run the test.

message

string

Notification message associated with the test.

monitor_id

int64

The associated monitor ID.

name

string

Name of the test.

options

object

Object describing the extra options for a Synthetic test.

accept_self_signed

boolean

For SSL test, whether or not the test should allow self signed certificates.

allow_insecure

boolean

Allows loading insecure content for an HTTP request in an API test.

checkCertificateRevocation

boolean

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.

ci

object

CI/CD options for a Synthetic test.

executionRule [required]

enum

Execution rule for a Synthetic test. Allowed enum values: blocking,non_blocking,skipped

device_ids

[string]

For browser test, array with the different device IDs used to run the test.

disableCors

boolean

Whether or not to disable CORS mechanism.

disableCsp

boolean

Disable Content Security Policy for browser tests.

enableProfiling

boolean

Enable profiling for browser tests.

enableSecurityTesting

boolean

DEPRECATED: Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.

follow_redirects

boolean

For API HTTP test, whether or not the test should follow redirects.

httpVersion

enum

HTTP version to use for a Synthetic test. Allowed enum values: http1,http2,any

ignoreServerCertificateError

boolean

Ignore server certificate error for browser tests.

initialNavigationTimeout

int64

Timeout before declaring the initial step as failed (in seconds) for browser tests.

min_failure_duration

int64

Minimum amount of time in failure required to trigger an alert.

min_location_failed

int64

Minimum number of locations in failure required to trigger an alert.

monitor_name

string

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.

monitor_options

object

Object containing the options for a Synthetic test as a monitor (for example, renotification).

escalation_message

string

Message to include in the escalation notification.

notification_preset_name

enum

The name of the preset for the notification for the monitor. Allowed enum values: show_all,hide_all,hide_query,hide_handles

renotify_interval

int64

Time interval before renotifying if the test is still failing (in minutes).

renotify_occurrences

int64

The number of times to renotify if the test is still failing.

monitor_priority

int32

Integer from 1 (high) to 5 (low) indicating alert severity.

noScreenshot

boolean

Prevents saving screenshots of the steps.

restricted_roles

[string]

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.

retry

object

Object describing the retry strategy to apply to a Synthetic test.

count

int64

Number of times a test needs to be retried before marking a location as failed. Defaults to 0.

interval

double

Time interval between retries (in milliseconds). Defaults to 300ms.

rumSettings

object

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.

applicationId

string

RUM application ID used to collect RUM data for the browser test.

clientTokenId

int64

RUM application API key ID used to collect RUM data for the browser test.

isEnabled [required]

boolean

Determines whether RUM data is collected during test runs.

scheduling

object

Object containing timeframes and timezone used for advanced scheduling.

timeframes [required]

[object]

Array containing objects describing the scheduling pattern to apply to each day.

day [required]

int32

Number representing the day of the week.

from [required]

string

The hour of the day on which scheduling starts.

to [required]

string

The hour of the day on which scheduling ends.

timezone [required]

string

Timezone in which the timeframe is based.

tick_every

int64

The frequency at which to run the Synthetic test (in seconds).

public_id

string

The test public ID.

status

enum

Define whether you want to start (live) or pause (paused) a Synthetic test. Allowed enum values: live,paused

steps

[object]

For browser test, the steps of the test.

allowFailure

boolean

A boolean set to allow this step to fail.

alwaysExecute

boolean

A boolean set to always execute this step even if the previous step failed or was skipped.

exitIfSucceed

boolean

A boolean set to exit the test if the step succeeds.

isCritical

boolean

A boolean to use in addition to allowFailure to determine if the test should be marked as failed when the step fails.

name

string

The name of the step.

noScreenshot

boolean

A boolean set to skip taking a screenshot for the step.

params

object

The parameters of the step.

public_id

string

The public ID of the step.

timeout

int64

The time before declaring a step failed.

type

enum

Step type used in your Synthetic test. Allowed enum values: assertCurrentUrl,assertElementAttribute,assertElementContent,assertElementPresent,assertEmail,assertFileDownload,assertFromJavascript,assertPageContains,assertPageLacks,click,extractFromJavascript,extractVariable,goToEmailLink,goToUrl,goToUrlAndMeasureTti,hover,playSubTest,pressKey,refresh,runApiTest,scroll,selectOption,typeText,uploadFiles,wait

subtype

enum

The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. Allowed enum values: http,ssl,tcp,dns,multi,icmp,udp,websocket,grpc

tags

[string]

Array of tags attached to the test.

type

enum

Type of the Synthetic test, either api or browser. Allowed enum values: api,browser,mobile

{
  "config": {
    "assertions": [
      {
        "operator": "contains",
        "property": "string",
        "target": 123456,
        "timingsScope": "string",
        "type": "statusCode"
      }
    ],
    "configVariables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ],
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "type": "web",
        "username": "my_username"
      },
      "body": "string",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        },
        "key": {
          "content": "string",
          "filename": "string",
          "updatedAt": "string"
        }
      },
      "certificateDomains": [],
      "compressedJsonDescriptor": "string",
      "compressedProtoFile": "string",
      "dnsServer": "string",
      "dnsServerPort": "string",
      "files": [
        {
          "bucketKey": "string",
          "content": "string",
          "name": "string",
          "originalFileName": "string",
          "size": "integer",
          "type": "string"
        }
      ],
      "follow_redirects": false,
      "headers": {
        "<any-key>": "string"
      },
      "host": "string",
      "httpVersion": "string",
      "message": "string",
      "metadata": {
        "<any-key>": "string"
      },
      "method": "string",
      "noSavingResponseBody": false,
      "numberOfPackets": "integer",
      "persistCookies": false,
      "port": {
        "description": "undefined",
        "format": "undefined",
        "type": "undefined"
      },
      "proxy": {
        "headers": {
          "<any-key>": "string"
        },
        "url": "https://example.com"
      },
      "query": {},
      "servername": "string",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": "number",
      "url": "https://example.com"
    },
    "variables": [
      {
        "example": "string",
        "id": "string",
        "name": "VARIABLE_NAME",
        "pattern": "string",
        "secure": false,
        "type": "text"
      }
    ]
  },
  "creator": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "message": "string",
  "monitor_id": "integer",
  "name": "string",
  "options": {
    "accept_self_signed": false,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "blocking"
    },
    "device_ids": [
      "chrome.laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "enableProfiling": false,
    "enableSecurityTesting": false,
    "follow_redirects": false,
    "httpVersion": "string",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": "integer",
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "monitor_name": "string",
    "monitor_options": {
      "escalation_message": "string",
      "notification_preset_name": "string",
      "renotify_interval": "integer",
      "renotify_occurrences": "integer"
    },
    "monitor_priority": "integer",
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": "integer",
      "interval": "number"
    },
    "rumSettings": {
      "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "clientTokenId": 12345,
      "isEnabled": true
    },
    "scheduling": {
      "timeframes": [
        {
          "day": 1,
          "from": "07:00",
          "to": "16:00"
        }
      ],
      "timezone": "America/New_York"
    },
    "tick_every": "integer"
  },
  "public_id": "string",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "alwaysExecute": false,
      "exitIfSucceed": false,
      "isCritical": false,
      "name": "string",
      "noScreenshot": false,
      "params": {},
      "public_id": "string",
      "timeout": "integer",
      "type": "assertElementContent"
    }
  ],
  "subtype": "http",
  "tags": [],
  "type": "string"
}

- JSON format is wrong - Creation failed

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Test quota is reached

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

Error response object.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/synthetics/tests" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "config": { "configVariables": [ { "name": "VARIABLE_NAME", "type": "text" } ], "request": { "proxy": { "url": "https://example.com" } }, "variables": [ { "name": "VARIABLE_NAME", "type": "text" } ] }, "options": { "ci": { "executionRule": "blocking" }, "rumSettings": { "isEnabled": true }, "scheduling": { "timeframes": [ { "day": 1, "from": "07:00", "to": "16:00" } ], "timezone": "America/New_York" } } } EOF

PREVIEWING: carles.capell/nodejs-security-controls
Your Privacy Choices