Get an API test result
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}https://api.datadoghq.eu/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.ap1.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.ap2.datadoghq.com/api/v1/synthetics/tests/{public_id}/results/{result_id}https://api.uk1.datadoghq.com/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.us2.ddog-gov.com/api/v1/synthetics/tests/{public_id}/results/{result_id}Overview
Get a specific full result from a given Synthetic API test.
OAuth apps require the synthetics_read authorization scope to access this endpoint.
Arguments
Path Parameters
public_id [required]The public ID of the API test to which the target result belongs.
result_id [required]The ID of the result to get.
Response
OK
Object returned describing a API test result.
checkObject describing the API test configuration.
config [required]Configuration 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, textcheck_timeWhen the API test was conducted.
check_versionVersion of the API test used.
probe_dcLocations for which to query the API test results.
resultObject containing results for your Synthetic API test.
certObject describing the SSL certificate used for a Synthetic test.
cipherCipher used for the connection.
exponentExponent associated to the certificate.
extKeyUsageArray of extensions and details used for the certificate.
fingerprintMD5 digest of the DER-encoded Certificate information.
fingerprint256SHA-1 digest of the DER-encoded Certificate information.
issuerObject describing the issuer of a SSL certificate.
CCountry Name that issued the certificate.
CNCommon Name that issued certificate.
LLocality that issued the certificate.
OOrganization that issued the certificate.
OUOrganizational Unit that issued the certificate.
STState Or Province Name that issued the certificate.
modulusModulus associated to the SSL certificate private key.
protocolTLS protocol used for the test.
serialNumberSerial Number assigned by Symantec to the SSL certificate.
subjectObject describing the SSL certificate used for the test.
CCountry Name associated with the certificate.
CNCommon Name that associated with the certificate.
LLocality associated with the certificate.
OOrganization associated with the certificate.
OUOrganizational Unit associated with the certificate.
STState Or Province Name associated with the certificate.
altNameSubject Alternative Name associated with the certificate.
validFromDate from which the SSL certificate is valid.
validToDate until which the SSL certificate is valid.
eventTypeStatus of a Synthetic test.
not_scheduled, scheduled, finished, finished_with_errorfailureThe API test failure details.
codeError code that can be returned by a Synthetic test.
BODY_TOO_LARGE, DENIED, TOO_MANY_REDIRECTS, AUTHENTICATION_ERROR, DECRYPTION, INVALID_CHAR_IN_HEADER, HEADER_TOO_LARGE, HEADERS_INCOMPATIBLE_CONTENT_LENGTH, INVALID_REQUEST, REQUIRES_UPDATEShow 16 more
UNESCAPED_CHARACTERS_IN_REQUEST_PATH, MALFORMED_RESPONSE, INCORRECT_ASSERTION, CONNREFUSED, CONNRESET, DNS, HOSTUNREACH, NETUNREACH, TIMEOUT, SSL, OCSP, INVALID_TEST, TUNNEL, WEBSOCKET, UNKNOWN, INTERNAL_ERRORmessageThe API test error message.
httpStatusCodeThe API test HTTP status code.
requestHeadersRequest header object used for the API test.
<any-key>Requested request header.
responseBodyResponse body returned for the API test.
responseHeadersResponse headers returned for the API test.
<any-key>Returned request header.
responseSizeGlobal size in byte of the API test response.
timingsObject containing all metrics and their values collected for a Synthetic API test. See the Synthetic Monitoring Metrics documentation.
dnsThe duration in millisecond of the DNS lookup.
downloadThe time in millisecond to download the response.
firstByteThe time in millisecond to first byte.
handshakeThe duration in millisecond of the TLS handshake.
redirectThe time in millisecond spent during redirections.
sslThe duration in millisecond of the TLS handshake.
tcpTime in millisecond to establish the TCP connection.
totalThe overall time in millisecond the request took to be processed.
waitTime spent in millisecond waiting for a response.
result_idID of the API test result.
statusThe status of your Synthetic monitor.
Ofor not triggered1for triggered2for no data
0, 1, 2{
"check": {
"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"
}
]
}
},
"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.
errors [required]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.
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"
]
}Code Example
# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export public_id="CHANGE_ME"
export result_id="CHANGE_ME"
# 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/${public_id}/results/${result_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Get an API test result returns "OK" 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.GetAPITestResult(ctx, "hwb-332-3xe", "3420446318379485707")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.GetAPITestResult`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.GetAPITestResult`:\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 an API test result returns "OK" 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.SyntheticsAPITestResultFull;
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 {
SyntheticsAPITestResultFull result =
apiInstance.getAPITestResult("hwb-332-3xe", "3420446318379485707");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SyntheticsApi#getAPITestResult");
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 an API test result returns "OK" 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.get_api_test_result(
public_id="hwb-332-3xe",
result_id="3420446318379485707",
)
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 an API test result returns "OK" 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.get_api_test_result("hwb-332-3xe", "3420446318379485707")
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 an API test result returns "OK" response
use datadog_api_client::datadog;
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
.get_api_test_result("hwb-332-3xe".to_string(), "3420446318379485707".to_string())
.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 an API test result returns "OK" 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);
const params: v1.SyntheticsApiGetAPITestResultRequest = {
publicId: "hwb-332-3xe",
resultId: "3420446318379485707",
};
apiInstance
.getAPITestResult(params)
.then((data: v1.SyntheticsAPITestResultFull) => {
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>'
}
test_id = '<SYNTHETICS_TEST_PUBLIC_ID>'
result_id = '<TEST_RESULT_ID>'
initialize(**options)
api.Synthetics.get_result(id=test_id, result_id=result_id)
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>'
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.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"