For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/fr/api/latest/rum/get-a-javascript-source-map.md. A documentation index is available at /llms.txt.
Language
Datadog site

Get a JavaScript source map

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
GEThttps://api.datadoghq.com/api/v2/sourcemapshttps://api.us3.datadoghq.com/api/v2/sourcemapshttps://api.us5.datadoghq.com/api/v2/sourcemapshttps://api.datadoghq.eu/api/v2/sourcemapshttps://api.ap1.datadoghq.com/api/v2/sourcemapshttps://api.ap2.datadoghq.com/api/v2/sourcemapshttps://api.uk1.datadoghq.com/api/v2/sourcemapshttps://api.ddog-gov.com/api/v2/sourcemapshttps://api.us2.ddog-gov.com/api/v2/sourcemaps

Présentation

Retrieves the content of a specific JavaScript source map file. Provide either debug_id with a UUID, or all three of filename, service, and version. When debug_id is provided, filename, service, and version are not required and are ignored.

Examples: the following commands use the US1 API host. Replace the host with the API host for your site, and the filename, service, version, and debug ID with values from your organization. Use --get so curl sends the parameters in the query string.

1. Retrieve a source map by debug ID

Provide debug_id with a UUID. No filename, service, or version is required.

curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
  --data-urlencode "debug_id=00000000-0000-4000-8000-000000000001"

2. Retrieve a source map by service and version

Provide filename together with service and version.

curl -sS --get "https://api.datadoghq.com/api/v2/sourcemaps" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
  --data-urlencode "filename=js/bundle.min.js.map" \
  --data-urlencode "service=my-web-service" \
  --data-urlencode "version=1.0.0"

This endpoint requires the rum_apps_read permission.

Arguments

Chaînes de requête

Name
Type
Description
debug_id
string

The debug ID of the JavaScript source map, in UUID format. When provided, filename, service, and version are not required and are ignored.

filename
string

The path to the source map file. Required when debug_id is omitted.

service
string

The service name associated with the source map. Required when debug_id is omitted.

version
string

The version of the service associated with the source map. Required when debug_id is omitted.

Réponse

OK

Response containing a JavaScript source map file.

Champ
Type
Description
data [required]
object

JavaScript source map file data object.

Exemple de code

# 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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-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/v2/sourcemaps" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"