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

Get presigned URLs for uploading a test file

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

Descripción general

Get presigned URLs for uploading a file to a Synthetic test using multipart upload. Returns the presigned URLs for each part along with the bucket key that references the file.

This endpoint requires any of the following permissions:

  • synthetics_write
  • synthetics_create_edit_trigger

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

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
public_id [required]
string

The public ID of the Synthetic test.

Solicitud

Body Data (required)

Campo
Type
Descripción
bucketKeyPrefix [required]
enum

The bucket key prefix indicating the type of file upload.

Allowed enum values: api-upload-file, browser-upload-file-step
parts [required]
[object]

Array of part descriptors for the multipart upload.

Respuesta

OK

Response containing presigned URLs for multipart file upload and the bucket key.

Campo
Type
Descripción
bucketKey
string

The bucket key that references the uploaded file after completion.

multipart_presigned_urls_params
object

Presigned URL parameters returned for a multipart upload.

Ejemplo de código

Get presigned URLs for uploading a test file
# 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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
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/multipart-presigned-urls" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bucketKeyPrefix": "api-upload-file",
  "parts": [
    {
      "md5": "1B2M2Y8AsgTpgAmY7PhCfg==",
      "partNumber": 1
    }
  ]
}
EOF