For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/synthetics/get-a-presigned-url-for-downloading-a-test-file.md. A documentation index is available at /llms.txt.
Language
Datadog site

Get a presigned URL for downloading a test file

POSThttps://api.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.us3.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.us5.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.datadoghq.eu/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.ap1.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.ap2.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.uk1.datadoghq.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.ddog-gov.com/api/v2/synthetics/tests/{public_id}/files/downloadhttps://api.us2.ddog-gov.com/api/v2/synthetics/tests/{public_id}/files/download

Overview

Get a presigned URL to download a file attached to a Synthetic test. The returned URL is temporary and expires after a short period.

This endpoint requires the synthetics_read permission.

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

Arguments

Path Parameters

Name
Type
Description
public_id [required]
string

The public ID of the Synthetic test.

Request

Body Data (required)

Field
Type
Description
bucketKey [required]
string

The bucket key referencing the file to download.

Response

OK

Response containing a presigned URL for downloading a test file.

Field
Type
Description
url
string

A presigned URL to download the file. The URL expires after a short period.

Code Example

# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF
# Path parameters
export public_id="abc-def-123"

# 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 POST "https://api.${DD_SITE}/api/v2/synthetics/tests/${public_id}/files/download" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"
}
EOF