모든 Synthetic 테스트의 목록 가져오기
https://api.datadoghq.com/api/v1/synthetics/testshttps://api.us3.datadoghq.com/api/v1/synthetics/testshttps://api.us5.datadoghq.com/api/v1/synthetics/testshttps://api.datadoghq.eu/api/v1/synthetics/testshttps://api.ap1.datadoghq.com/api/v1/synthetics/testshttps://api.ap2.datadoghq.com/api/v1/synthetics/testshttps://api.uk1.datadoghq.com/api/v1/synthetics/testshttps://api.ddog-gov.com/api/v1/synthetics/testshttps://api.us2.ddog-gov.com/api/v1/synthetics/tests개요
모든 Synthetic 테스트의 목록을 가져옵니다.
OAuth apps require the synthetics_read authorization scope to access this endpoint.
인수
쿼리 문자열
page_sizeUsed for pagination. The number of tests returned in the page.
100page_numberUsed for pagination. Which page you want to retrieve. Starts at zero.
응답
OK - Returns the list of all Synthetic tests.
Object containing an array of Synthetic tests configuration.
testsArray of Synthetic tests configuration.
configConfiguration object for a Synthetic test.
assertionsArray of assertions used for the test. Required for single API tests.
Object 1An assertion which uses a simple target.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedpropertyThe associated assertion property.
target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
timingsScopeTimings scope for response time assertions.
all, withoutDNStype [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 2An assertion which targets body hash.
operator [required]Assertion operator to apply.
md5, sha1, sha256target [required]Value used by the operator.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
bodyHashObject 3An assertion for the validatesJSONPath operator.
operator [required]Assertion operator to apply.
validatesJSONPathpropertyThe associated assertion property.
targetComposed target for validatesJSONPath operator.
elementsOperatorThe 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.
jsonPathThe JSON path to assert.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 4An assertion for the validatesJSONSchema operator.
operator [required]Assertion operator to apply.
validatesJSONSchematargetComposed target for validatesJSONSchema operator.
jsonSchemaThe JSON Schema to assert.
metaSchemaThe JSON Schema meta-schema version used in the assertion.
draft-07, draft-06type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 5An assertion for the validatesXPath operator.
operator [required]Assertion operator to apply.
validatesXPathpropertyThe associated assertion property.
targetComposed target for validatesXPath operator.
operatorThe specific operator to use on the path.
targetValueThe path target value to compare to.
Object 1Numeric value used by the operator in assertions.
Object 2String value used by the operator in assertions. Supports templated variables.
xPathThe X path to assert.
type [required]Type of the assertion.
body, header, statusCode, certificate, responseTime, property, recordEvery, recordSome, tlsVersion, minTlsVersionShow 13 more
latency, packetLossPercentage, packetsReceived, networkHop, receivedMessage, grpcHealthcheckStatus, grpcMetadata, grpcProto, connection, multiNetworkHop, jitter, mcpToolNameLength, mcpToolCountObject 6A JavaScript assertion.
code [required]The JavaScript code that performs the assertions.
type [required]Type of the assertion.
javascriptObject 7An assertion that checks that an MCP server advertises the expected capabilities.
operator [required]Assertion operator to apply.
contains, doesNotContain, is, isNot, lessThan, lessThanOrEqual, moreThan, moreThanOrEqual, matches, doesNotMatchShow 5 more
validates, isInMoreThan, isInLessThan, doesNotExist, isUndefinedtarget [required]List of MCP server capabilities to assert against.
type [required]Type of the assertion.
mcpServerCapabilitiesObject 8An assertion that verifies the MCP server response respects the MCP specification.
type [required]Type of the assertion.
mcpRespectsSpecificationconfigVariablesArray of variables used for the test.
exampleExample for the variable.
idID of the variable for global variables.
name [required]Name of the variable.
patternPattern of the variable.
secureWhether the value of this variable will be obfuscated in test results. Only for config variables of type text.
type [required]Type of the configuration variable.
global, text, emailrequestObject describing the Synthetic test request.
allow_insecureAllows loading insecure content for an HTTP request in a multistep test step.
basicAuthObject to handle basic authentication when performing the test.
<type=web>Object to handle basic authentication when performing the test.
passwordPassword to use for the basic authentication.
typeThe type of basic authentication to use when performing the test.
webwebusernameUsername to use for the basic authentication.
<type=sigv4>Object to handle SIGV4 authentication when performing the test.
accessKey [required]Access key for the SIGV4 authentication.
regionRegion for the SIGV4 authentication.
secretKey [required]Secret key for the SIGV4 authentication.
serviceNameService name for the SIGV4 authentication.
sessionTokenSession token for the SIGV4 authentication.
type [required]The type of authentication to use when performing the test.
sigv4sigv4<type=ntlm>Object to handle NTLM authentication when performing the test.
domainDomain for the authentication to use when performing the test.
passwordPassword for the authentication to use when performing the test.
type [required]The type of authentication to use when performing the test.
ntlmntlmusernameUsername for the authentication to use when performing the test.
workstationWorkstation for the authentication to use when performing the test.
<type=digest>Object to handle digest authentication when performing the test.
password [required]Password to use for the digest authentication.
type [required]The type of basic authentication to use when performing the test.
digestdigestusername [required]Username to use for the digest authentication.
<type=oauth-client>Object to handle oauth client authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientId [required]Client ID to use when performing the authentication.
clientSecret [required]Client secret to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-clientoauth-client<type=oauth-rop>Object to handle oauth rop authentication when performing the test.
accessTokenUrl [required]Access token URL to use when performing the authentication.
audienceAudience to use when performing the authentication.
clientIdClient ID to use when performing the authentication.
clientSecretClient secret to use when performing the authentication.
password [required]Password to use when performing the authentication.
resourceResource to use when performing the authentication.
scopeScope to use when performing the authentication.
tokenApiAuthentication [required]Type of token to use when performing the authentication.
header, bodytype [required]The type of basic authentication to use when performing the test.
oauth-ropoauth-ropusername [required]Username to use when performing the authentication.
<type=jwt>Object to handle JWT authentication when performing the test.
addClaimsStandard JWT claims to automatically inject.
expWhether to inject the exp (expiration) claim.
iatWhether to inject the iat (issued at) claim.
algorithm [required]Algorithm to use for the JWT authentication.
HS256, RS256, ES256expiresInToken time-to-live in seconds.
headerCustom JWT header as a JSON string.
payload [required]JWT claims as a JSON string.
secret [required]Signing key for the JWT authentication. Use the shared secret for HS256
or the private key (PEM format) for RS256 and ES256.
tokenPrefixPrefix added before the token in the Authorization header. Defaults to Bearer.
type [required]The type of authentication to use when performing the test.
jwtjwtbodyBody to include in the test.
bodyTypeType of the request body.
text/plain, application/json, text/xml, text/html, application/x-www-form-urlencoded, graphql, application/octet-stream, multipart/form-datacallTypeThe type of call to perform. Used by gRPC steps (healthcheck, unary)
and MCP steps (init, tool_list, tool_call). Valid values depend on
the parent step's subtype.
healthcheck, unary, init, tool_list, tool_callcertificateClient certificate to use when performing the test request.
certDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
keyDefine a request certificate.
contentContent of the certificate or key.
filenameFile name for the certificate or key.
updatedAtDate of update of the certificate or key, ISO format.
certificateDomainsBy 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.
checkCertificateRevocationCheck for certificate revocation.
compressedJsonDescriptorA protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
compressedProtoFileA protobuf file that needs to be gzipped first then base64 encoded.
disableAiaIntermediateFetchingDisable fetching intermediate certificates from AIA.
dnsServerDNS server to use for DNS tests.
dnsServerPortDNS server port to use for DNS tests.
Object 1Integer DNS server port number to use when performing the test.
Object 2String DNS server port number to use when performing the test. Supports templated variables.
filesFiles to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
bucketKeyBucket key of the file.
contentContent of the file.
encodingEncoding of the file content. The only supported value is base64, indicating the content field contains base64-encoded data.
nameName of the file.
originalFileNameOriginal name of the file.
sizeSize of the file.
typeType of the file.
follow_redirectsSpecifies whether or not the request follows redirects.
formForm to be used as part of the request in the test. Only valid if bodyType is multipart/form-data.
<any-key>A single form entry.
headersHeaders to include when performing the test.
<any-key>A single Header.
hostHost name to perform the test with.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
isMessageBase64EncodedWhether the message is base64 encoded.
mcpProtocolVersionThe MCP protocol version used by the step. See https://modelcontextprotocol.io/specification.
2025-06-18messageMessage to send for UDP or WebSocket tests.
metadataMetadata to include when performing the gRPC test.
<any-key>A single metadatum.
methodEither 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.
noSavingResponseBodyDetermines whether or not to save the response body.
numberOfPacketsNumber of pings to use per test.
persistCookiesPersist cookies across redirects.
portPort to use when performing the test.
Object 1Integer Port number to use when performing the test.
Object 2String Port number to use when performing the test. Supports templated variables.
proxyThe proxy to perform the test.
headersHeaders to include when performing the test.
<any-key>A single Header.
url [required]URL of the proxy to perform the test.
queryQuery to use for the test.
servernameFor 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.
serviceThe gRPC service on which you want to perform the gRPC call.
shouldTrackHopsTurns on a traceroute probe to discover all gateways along the path to the host destination.
timeoutTimeout in seconds for the test.
toolArgsArguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when callType is tool_call.
toolNameThe name of the MCP tool to call. Required when callType is tool_call.
urlURL to perform the test with.
variablesBrowser tests only - array of variables used for the test steps.
exampleExample for the variable.
idID for the variable. Global variables require an ID.
name [required]Name of the variable.
patternPattern of the variable.
secureDetermines whether or not the browser test variable is obfuscated. Can only be used with browser variables of type text.
type [required]Type of browser test variable.
element, email, global, textcreatorObject describing the creator of the shared element.
emailEmail of the creator.
handleHandle of the creator.
nameName of the creator.
locationsArray of locations used to run the test.
messageNotification message associated with the test.
monitor_idThe associated monitor ID.
nameName of the test.
optionsObject describing the extra options for a Synthetic test.
accept_self_signedFor SSL tests, whether or not the test should allow self signed certificates.
allow_insecureAllows loading insecure content for an HTTP request in an API test.
bits_ai_auto_investigateWhether Bits AI automatically investigates alerts from the test monitor.
blockedRequestPatternsArray of URL patterns to block.
captureNetworkPayloadsCapture HTTP request/response headers and bodies for Fetch/XHR calls made during browser tests.
checkCertificateRevocationFor SSL tests, whether or not the test should fail on revoked certificate in stapled OCSP.
ciCI/CD options for a Synthetic test.
executionRule [required]Execution rule for a Synthetic test.
blocking, non_blocking, skippeddevice_idsFor browser test, array with the different device IDs used to run the test.
disableAiaIntermediateFetchingFor SSL tests, whether or not the test should disable fetching intermediate certificates from AIA.
disableCorsWhether or not to disable CORS mechanism.
disableCspDisable Content Security Policy for browser tests.
enableProfilingEnable profiling for browser tests.
enableSecurityTestingDEPRECATED Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.
follow_redirectsFor API HTTP test, whether or not the test should follow redirects.
httpVersionHTTP version to use for a Synthetic test.
http1, http2, anyignoreServerCertificateErrorIgnore server certificate error for browser tests.
ignore_certificate_validationFor SSL tests, whether the test should ignore certificate validation.
initialNavigationTimeoutTimeout before declaring the initial step as failed (in seconds) for browser tests.
min_failure_durationMinimum amount of time in failure required to trigger an alert.
min_location_failedMinimum number of locations in failure required to trigger an alert.
monitor_nameThe monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.
monitor_optionsObject containing the options for a Synthetic test as a monitor (for example, renotification).
escalation_messageMessage to include in the escalation notification.
notification_preset_nameThe name of the preset for the notification for the monitor.
show_all, hide_all, hide_query, hide_handles, hide_query_and_handles, show_only_snapshot, hide_handles_and_footerrenotify_intervalTime interval before renotifying if the test is still failing (in minutes).
renotify_occurrencesThe number of times to renotify if the test is still failing.
monitor_priorityInteger from 1 (high) to 5 (low) indicating alert severity.
noScreenshotPrevents saving screenshots of the steps.
restricted_rolesDEPRECATED A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
retryObject describing the retry strategy to apply to a Synthetic test.
countNumber of times a test needs to be retried before marking a location as failed. Defaults to 0.
intervalTime interval between retries (in milliseconds). Defaults to 300ms.
rumSettingsThe 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.
applicationIdRUM application ID used to collect RUM data for the browser test.
clientTokenIdRUM application API key ID used to collect RUM data for the browser test.
isEnabled [required]Determines whether RUM data is collected during test runs.
schedulingObject containing timeframes and timezone used for advanced scheduling.
timeframes [required]Array containing objects describing the scheduling pattern to apply to each day.
day [required]Number representing the day of the week.
from [required]The hour of the day on which scheduling starts.
to [required]The hour of the day on which scheduling ends.
timezone [required]Timezone in which the timeframe is based.
tick_everyThe frequency at which to run the Synthetic test (in seconds).
public_idThe test public ID.
statusDefine whether you want to start (live) or pause (paused) a
Synthetic test.
live, pausedsubtypeThe subtype of the Synthetic API test, http, ssl, tcp,
dns, icmp, udp, websocket, grpc or multi.
http, ssl, tcp, dns, multi, icmp, udp, websocket, grpctagsArray of tags attached to the test.
typeType of the Synthetic test.
api, browser, mobile, network{
"tests": [
{
"config": {
"assertions": [
{
"operator": "contains",
"property": "string",
"target": 0,
"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": [],
"checkCertificateRevocation": false,
"compressedJsonDescriptor": "string",
"compressedProtoFile": "string",
"disableAiaIntermediateFetching": false,
"dnsServer": "string",
"dnsServerPort": {
"description": "undefined",
"format": "undefined",
"type": "undefined"
},
"files": [
{
"bucketKey": "string",
"content": "string",
"encoding": "string",
"name": "string",
"originalFileName": "string",
"size": "integer",
"type": "string"
}
],
"follow_redirects": false,
"form": {
"<any-key>": "string"
},
"headers": {
"<any-key>": "string"
},
"host": "string",
"httpVersion": "string",
"ignore_certificate_validation": false,
"isMessageBase64Encoded": false,
"mcpProtocolVersion": "2025-06-18",
"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",
"toolArgs": {},
"toolName": "search",
"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,
"bits_ai_auto_investigate": false,
"blockedRequestPatterns": [],
"captureNetworkPayloads": false,
"checkCertificateRevocation": false,
"ci": {
"executionRule": "blocking"
},
"device_ids": [
"chrome.laptop_large"
],
"disableAiaIntermediateFetching": false,
"disableCors": false,
"disableCsp": false,
"enableProfiling": false,
"enableSecurityTesting": false,
"follow_redirects": false,
"httpVersion": "string",
"ignoreServerCertificateError": false,
"ignore_certificate_validation": 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",
"subtype": "http",
"tags": [],
"type": "string"
}
]
}Forbidden
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Synthetic Monitoring is not activated for the user.
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Too many requests
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}코드 예시
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v1/synthetics/tests" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewSyntheticsApi(apiClient)
resp, r, err := api.ListTests(ctx, *datadogV1.NewListTestsOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.ListTests`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.ListTests`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests."
// response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.SyntheticsApi;
import com.datadog.api.client.v1.model.SyntheticsListTestsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
SyntheticsApi apiInstance = new SyntheticsApi(defaultClient);
try {
SyntheticsListTestsResponse result = apiInstance.listTests();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#listTests");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.list_tests()
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
p api_instance.list_tests()
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Get the list of all Synthetic tests returns "OK - Returns the list of all
// Synthetic tests." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_synthetics::ListTestsOptionalParams;
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api.list_tests(ListTestsOptionalParams::default()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Get the list of all Synthetic tests returns "OK - Returns the list of all Synthetic tests." response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v1.SyntheticsApi(configuration);
apiInstance
.listTests()
.then((data: v1.SyntheticsListTestsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"from datadog import initialize, api
options = {
'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'
}
initialize(**options)
api.Synthetics.get_all_tests()
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"DD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"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.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"