Créer une playlist RUM
https://api.datadoghq.com/api/v2/rum/replay/playlistshttps://api.us3.datadoghq.com/api/v2/rum/replay/playlistshttps://api.us5.datadoghq.com/api/v2/rum/replay/playlistshttps://api.datadoghq.eu/api/v2/rum/replay/playlistshttps://api.ap1.datadoghq.com/api/v2/rum/replay/playlistshttps://api.ap2.datadoghq.com/api/v2/rum/replay/playlistshttps://api.uk1.datadoghq.com/api/v2/rum/replay/playlistshttps://api.ddog-gov.com/api/v2/rum/replay/playlistshttps://api.us2.ddog-gov.com/api/v2/rum/replay/playlistsPrésentation
Créez une playlist.
Requête
Body Data (required)
data [required]attributesAttributes of a RUM replay playlist, including its name, description, session count, and audit timestamps.
created_atTimestamp when the playlist was created.
created_byInformation about the user who created the playlist.
handle [required]Email handle of the user who created the playlist.
iconURL or identifier of the user's avatar icon.
id [required]Unique identifier of the user who created the playlist.
nameDisplay name of the user who created the playlist.
uuid [required]UUID of the user who created the playlist.
descriptionOptional human-readable description of the playlist's purpose or contents.
name [required]Human-readable name of the playlist.
session_countNumber of replay sessions in the playlist.
updated_atTimestamp when the playlist was last updated.
idUnique identifier of the playlist.
type [required]Rum replay playlist resource type.
rum_replay_playlistrum_replay_playlist{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"created_by": {
"handle": "john.doe@example.com",
"icon": "string",
"id": "00000000-0000-0000-0000-000000000001",
"name": "string",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"description": "string",
"name": "My Playlist",
"session_count": "integer",
"updated_at": "2019-09-19T10:00:00.000Z"
},
"id": "string",
"type": "rum_replay_playlist"
}
}Réponse
Created
A single RUM replay playlist resource returned by create, update, or get operations.
data [required]Data object representing a RUM replay playlist, including its identifier, type, and attributes.
attributesAttributes of a RUM replay playlist, including its name, description, session count, and audit timestamps.
created_atTimestamp when the playlist was created.
created_byInformation about the user who created the playlist.
handle [required]Email handle of the user who created the playlist.
iconURL or identifier of the user's avatar icon.
id [required]Unique identifier of the user who created the playlist.
nameDisplay name of the user who created the playlist.
uuid [required]UUID of the user who created the playlist.
descriptionOptional human-readable description of the playlist's purpose or contents.
name [required]Human-readable name of the playlist.
session_countNumber of replay sessions in the playlist.
updated_atTimestamp when the playlist was last updated.
idUnique identifier of the playlist.
type [required]Rum replay playlist resource type.
rum_replay_playlistrum_replay_playlist{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"created_by": {
"handle": "john.doe@example.com",
"icon": "string",
"id": "00000000-0000-0000-0000-000000000001",
"name": "string",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"description": "string",
"name": "My Playlist",
"session_count": "integer",
"updated_at": "2019-09-19T10:00:00.000Z"
},
"id": "string",
"type": "rum_replay_playlist"
}
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}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 POST "https://api.${DD_SITE}/api/v2/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF# 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/rum/replay/playlists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"created_by": {
"handle": "john.doe@example.com",
"id": "00000000-0000-0000-0000-000000000001",
"uuid": "00000000-0000-0000-0000-000000000001"
},
"name": "My Playlist"
},
"type": "rum_replay_playlist"
}
}
EOF// Create RUM replay playlist returns "Created" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.Playlist{
Data: datadogV2.PlaylistData{
Attributes: &datadogV2.PlaylistDataAttributes{
CreatedBy: &datadogV2.PlaylistDataAttributesCreatedBy{
Handle: "john.doe@example.com",
Id: "00000000-0000-0000-0000-000000000001",
Uuid: "00000000-0000-0000-0000-000000000001",
},
Name: "My Playlist",
},
Type: datadogV2.PLAYLISTDATATYPE_RUM_REPLAY_PLAYLIST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewRumReplayPlaylistsApi(apiClient)
resp, r, err := api.CreateRumReplayPlaylist(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RumReplayPlaylistsApi.CreateRumReplayPlaylist`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `RumReplayPlaylistsApi.CreateRumReplayPlaylist`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Create RUM replay playlist returns "Created" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumReplayPlaylistsApi;
import com.datadog.api.client.v2.model.Playlist;
import com.datadog.api.client.v2.model.PlaylistData;
import com.datadog.api.client.v2.model.PlaylistDataAttributes;
import com.datadog.api.client.v2.model.PlaylistDataAttributesCreatedBy;
import com.datadog.api.client.v2.model.PlaylistDataType;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
RumReplayPlaylistsApi apiInstance = new RumReplayPlaylistsApi(defaultClient);
Playlist body =
new Playlist()
.data(
new PlaylistData()
.attributes(
new PlaylistDataAttributes()
.createdBy(
new PlaylistDataAttributesCreatedBy()
.handle("john.doe@example.com")
.id("00000000-0000-0000-0000-000000000001")
.uuid("00000000-0000-0000-0000-000000000001"))
.name("My Playlist"))
.type(PlaylistDataType.RUM_REPLAY_PLAYLIST));
try {
Playlist result = apiInstance.createRumReplayPlaylist(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RumReplayPlaylistsApi#createRumReplayPlaylist");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Create RUM replay playlist returns "Created" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_replay_playlists_api import RumReplayPlaylistsApi
from datadog_api_client.v2.model.playlist import Playlist
from datadog_api_client.v2.model.playlist_data import PlaylistData
from datadog_api_client.v2.model.playlist_data_attributes import PlaylistDataAttributes
from datadog_api_client.v2.model.playlist_data_attributes_created_by import PlaylistDataAttributesCreatedBy
from datadog_api_client.v2.model.playlist_data_type import PlaylistDataType
body = Playlist(
data=PlaylistData(
attributes=PlaylistDataAttributes(
created_by=PlaylistDataAttributesCreatedBy(
handle="john.doe@example.com",
id="00000000-0000-0000-0000-000000000001",
uuid="00000000-0000-0000-0000-000000000001",
),
name="My Playlist",
),
type=PlaylistDataType.RUM_REPLAY_PLAYLIST,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = RumReplayPlaylistsApi(api_client)
response = api_instance.create_rum_replay_playlist(body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Create RUM replay playlist returns "Created" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::RumReplayPlaylistsAPI.new
body = DatadogAPIClient::V2::Playlist.new({
data: DatadogAPIClient::V2::PlaylistData.new({
attributes: DatadogAPIClient::V2::PlaylistDataAttributes.new({
created_by: DatadogAPIClient::V2::PlaylistDataAttributesCreatedBy.new({
handle: "john.doe@example.com",
id: "00000000-0000-0000-0000-000000000001",
uuid: "00000000-0000-0000-0000-000000000001",
}),
name: "My Playlist",
}),
type: DatadogAPIClient::V2::PlaylistDataType::RUM_REPLAY_PLAYLIST,
}),
})
p api_instance.create_rum_replay_playlist(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Create RUM replay playlist returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_replay_playlists::RumReplayPlaylistsAPI;
use datadog_api_client::datadogV2::model::Playlist;
use datadog_api_client::datadogV2::model::PlaylistData;
use datadog_api_client::datadogV2::model::PlaylistDataAttributes;
use datadog_api_client::datadogV2::model::PlaylistDataAttributesCreatedBy;
use datadog_api_client::datadogV2::model::PlaylistDataType;
#[tokio::main]
async fn main() {
let body = Playlist::new(
PlaylistData::new(PlaylistDataType::RUM_REPLAY_PLAYLIST).attributes(
PlaylistDataAttributes::new("My Playlist".to_string()).created_by(
PlaylistDataAttributesCreatedBy::new(
"john.doe@example.com".to_string(),
"00000000-0000-0000-0000-000000000001".to_string(),
"00000000-0000-0000-0000-000000000001".to_string(),
),
),
),
);
let configuration = datadog::Configuration::new();
let api = RumReplayPlaylistsAPI::with_config(configuration);
let resp = api.create_rum_replay_playlist(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Create RUM replay playlist returns "Created" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.RumReplayPlaylistsApi(configuration);
const params: v2.RumReplayPlaylistsApiCreateRumReplayPlaylistRequest = {
body: {
data: {
attributes: {
createdBy: {
handle: "john.doe@example.com",
id: "00000000-0000-0000-0000-000000000001",
uuid: "00000000-0000-0000-0000-000000000001",
},
name: "My Playlist",
},
type: "rum_replay_playlist",
},
},
};
apiInstance
.createRumReplayPlaylist(params)
.then((data: v2.Playlist) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"