---
title: JavaScript 소스 맵 가져오기
description: 파일 이름, 서비스 이름 및 버전을 사용하여 특정 JavaScript 소스 맵 파일의 내용을 가져옵니다.
breadcrumbs: 문서 > API > JavaScript 소스 맵 가져오기
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# JavaScript 소스 맵 가져오기

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                        |
| ----------------- | --------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/sourcemaps     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/sourcemaps |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/sourcemaps |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/sourcemaps      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/sourcemaps |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/sourcemaps |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/sourcemaps |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/sourcemaps      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/sourcemaps  |

### Overview

파일 이름, 서비스 이름 및 버전을 사용하여 특정 JavaScript
소스 맵 파일의 내용을 가져옵니다.

This endpoint requires the `rum_apps_read` permission.

### Arguments

#### Query Strings

| Field    | 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.                                            |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a JavaScript source map file.

| Parent field | Field                            | Type      | Description                                                                                                       |
| ------------ | -------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                | object    | JavaScript source map file data object.                                                                           |
| data         | attributes [*required*]          | object    | Attributes of a JavaScript source map file.                                                                       |
| attributes   | file [*required*]                | string    | The name of the minified JavaScript file.                                                                         |
| attributes   | mappings [*required*]            | string    | The Base64 VLQ encoded string that maps positions in the minified file to positions in the original source files. |
| attributes   | minifiedLineLengths [*required*] | [integer] | List of character counts for each line in the minified file.                                                      |
| attributes   | names [*required*]               | [any]     | List of symbol names referenced in the mappings.                                                                  |
| attributes   | sourceRoot [*required*]          | string    | The root path prepended to source file paths.                                                                     |
| attributes   | sources [*required*]             | [string]  | List of original source file paths.                                                                               |
| attributes   | sourcesContent [*required*]      | [string]  | List of original source file contents corresponding to the paths in `sources`.                                    |
| attributes   | version [*required*]             | int64     | The version of the source map format (typically 3).                                                               |
| data         | id [*required*]                  | string    | The unique identifier of the source map file, typically the path to the file.                                     |
| data         | type [*required*]                | enum      | The resource type for source map file objects. Allowed enum values: `sourcemap_files`.                            |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "file": "bundle.js",
      "mappings": "AAAA,OAAO,CAAC,GAAG",
      "minifiedLineLengths": [
        50,
        30
      ],
      "names": [
        "console",
        "log"
      ],
      "sourceRoot": "/",
      "sources": [
        "src/index.js",
        "src/utils.js"
      ],
      "sourcesContent": [
        "console.log('index');",
        "export function util() {}"
      ],
      "version": 3
    },
    "id": "path/to/sourcemap.js.map",
    "type": "sourcemap_files"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="500" %}
Internal Server Error

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, 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}"
```
{% /tab %}
{% /tabs %}
