Embeddable Graphs
Rapport de recherche Datadog : Bilan sur l'adoption de l'informatique sans serveur Rapport : Bilan sur l'adoption de l'informatique sans serveur
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Embeddable Graphs

Interact with embeddable graphs through the API.

Create embed

post https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed

Overview

Creates a new embeddable graph.

Note: If an embed already exists for the exact same query in a given organization, the older embed is returned instead of creating a new embed.

If you are interested in using template variables, see Embeddable Graphs with Template Variables.

Request

Body Data

Embeddable Graph body

Expand All

Field

Type

Description

graph_json [required]

string

The graph definition in JSON.

Same format that is available on the JSON tab of the graph editor.

legend

enum

The flag determining if the graph includes a legend. Allowed enum values: yes,no

size

enum

The size of the graph. Allowed enum values: small,medium,large,xlarge

timeframe

enum

The timeframe for the graph. Allowed enum values: 1_hour,4_hours,1_day,2_days,1_week

title

string

Determines graph title. Must be at least 1 character.

{
  "graph_json": "",
  "legend": "string",
  "size": "string",
  "timeframe": "string",
  "title": "string"
}

Response

Payload accepted

Embeddable graph.

Expand All

Field

Type

Description

dash_name

string

Name of the dashboard the graph is on (null if none).

dash_url

string

URL of the dashboard the graph is on (null if none).

embed_id

string

ID of the embed.

graph_title

string

Title of the graph.

html

string

HTML fragment for the embed (iframe).

revoked

boolean

Boolean flag for whether or not the embed is revoked.

shared_by

int64

ID of the use who shared the embed.

{
  "dash_name": "string",
  "dash_url": "string",
  "embed_id": "string",
  "graph_title": "string",
  "html": "string",
  "revoked": false,
  "shared_by": "integer"
}

Bad Request

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Authentication Error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X post https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
  "graph_json": ""
}
EOF

                                        

Enable embed

get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/{embed_id}/enable

Overview

Enable a specified embed.

Arguments

Path Parameters

Name

Type

Description

embed_id [required]

string

ID of the embed.

Response

OK

A JSON containing the success message

Expand All

Field

Type

Description

success

string

Message.

{
  "success": "Embed 5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c successfully enabled."
}

Authentication Error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export embed_id="CHANGE_ME"
# Curl command curl -X get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/${embed_id}/enable \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Get all embeds

get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed

Overview

Gets a list of previously created embeddable graphs.

Response

OK

Response with embeddable graphs.

Expand All

Field

Type

Description

embedded_graphs

[object]

List of embeddable graphs.

dash_name

string

Name of the dashboard the graph is on (null if none).

dash_url

string

URL of the dashboard the graph is on (null if none).

embed_id

string

ID of the embed.

graph_title

string

Title of the graph.

html

string

HTML fragment for the embed (iframe).

revoked

boolean

Boolean flag for whether or not the embed is revoked.

shared_by

int64

ID of the use who shared the embed.

{
  "embedded_graphs": [
    {
      "dash_name": "string",
      "dash_url": "string",
      "embed_id": "string",
      "graph_title": "string",
      "html": "string",
      "revoked": false,
      "shared_by": "integer"
    }
  ]
}

Authentication Error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Curl command
curl -X get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

                                        

Get specific embed

get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/{embed_id}

Overview

Get the HTML fragment for a previously generated embed with embed_id.

Arguments

Path Parameters

Name

Type

Description

embed_id [required]

string

Token of the embed.

Response

OK

Embeddable graph.

Expand All

Field

Type

Description

dash_name

string

Name of the dashboard the graph is on (null if none).

dash_url

string

URL of the dashboard the graph is on (null if none).

embed_id

string

ID of the embed.

graph_title

string

Title of the graph.

html

string

HTML fragment for the embed (iframe).

revoked

boolean

Boolean flag for whether or not the embed is revoked.

shared_by

int64

ID of the use who shared the embed.

{
  "dash_name": "string",
  "dash_url": "string",
  "embed_id": "string",
  "graph_title": "string",
  "html": "string",
  "revoked": false,
  "shared_by": "integer"
}

Authentication Error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export embed_id="CHANGE_ME"
# Curl command curl -X get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/${embed_id} \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"

Revoke embed

get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/{embed_id}/revoke

Overview

Revoke a specified embed.

Arguments

Path Parameters

Name

Type

Description

embed_id [required]

string

ID of the embed.

Response

OK

A JSON containing the success message

Expand All

Field

Type

Description

success

string

Message.

{
  "success": "Embed 5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c successfully revoked."
}

Authentication Error

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Not found

Error response object.

Expand All

Field

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example


                                        # Path parameters
export embed_id="CHANGE_ME"
# Curl command curl -X get https://api.datadoghq.comhttps://api.datadoghq.eu/api/v1/graph/embed/${embed_id}/revoke \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"