Update replay heatmap snapshot
https://api.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.us3.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.us5.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.datadoghq.eu/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.ap1.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.ap2.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.uk1.datadoghq.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.ddog-gov.com/api/v2/replay/heatmap/snapshots/{snapshot_id}https://api.us2.ddog-gov.com/api/v2/replay/heatmap/snapshots/{snapshot_id}Overview
Update a heatmap snapshot.
Arguments
Path Parameters
snapshot_id [required]Unique identifier of the heatmap snapshot.
Request
Body Data (required)
data [required]Data object for a heatmap snapshot update request, containing the resource identifier, type, and attributes.
attributesAttributes for updating a heatmap snapshot, including event, session, and view context.
event_id [required]Unique identifier of the RUM event associated with the snapshot.
is_device_type_selected_by_user [required]Indicates whether the device type was explicitly selected by the user rather than auto-detected.
session_idUnique identifier of the RUM session associated with the snapshot.
start [required]Offset in milliseconds from the start of the session at which the snapshot was captured.
view_idUnique identifier of the RUM view associated with the snapshot.
idUnique identifier of the heatmap snapshot to update.
type [required]Snapshots resource type.
snapshotssnapshots{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"session_id": "string",
"start": 0,
"view_id": "string"
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}Response
OK
A single heatmap snapshot resource returned by create or update operations.
dataData object representing a heatmap snapshot, including its identifier, type, and attributes.
attributesAttributes of a heatmap snapshot, including view context, device information, and audit metadata.
application_idUnique identifier of the RUM application.
created_atTimestamp when the snapshot was created.
created_byDisplay name of the user who created the snapshot.
created_by_handleEmail handle of the user who created the snapshot.
created_by_user_idNumeric identifier of the user who created the snapshot.
device_typeDevice type used when capturing the snapshot (e.g., desktop, mobile, tablet).
event_idUnique identifier of the RUM event associated with the snapshot.
is_device_type_selected_by_userIndicates whether the device type was explicitly selected by the user rather than auto-detected.
modified_atTimestamp when the snapshot was last modified.
org_idNumeric identifier of the organization that owns the snapshot.
session_idUnique identifier of the RUM session associated with the snapshot.
snapshot_nameHuman-readable name for the snapshot.
startOffset in milliseconds from the start of the session at which the snapshot was captured.
view_idUnique identifier of the RUM view associated with the snapshot.
view_nameURL path or name of the view where the snapshot was captured.
idUnique identifier of the heatmap snapshot.
type [required]Snapshots resource type.
snapshotssnapshots{
"data": {
"attributes": {
"application_id": "string",
"created_at": "2019-09-19T10:00:00.000Z",
"created_by": "string",
"created_by_handle": "string",
"created_by_user_id": "integer",
"device_type": "string",
"event_id": "string",
"is_device_type_selected_by_user": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"org_id": "integer",
"session_id": "string",
"snapshot_name": "string",
"start": "integer",
"view_id": "string",
"view_name": "string"
},
"id": "string",
"type": "snapshots"
}
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF# Path parameters
export snapshot_id="00000000-0000-0000-0000-000000000001"
# 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 PATCH "https://api.${DD_SITE}/api/v2/replay/heatmap/snapshots/${snapshot_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"event_id": "11111111-2222-3333-4444-555555555555",
"is_device_type_selected_by_user": false,
"start": 0
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "snapshots"
}
}
EOF// Update replay heatmap snapshot returns "OK" 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.SnapshotUpdateRequest{
Data: datadogV2.SnapshotUpdateRequestData{
Attributes: &datadogV2.SnapshotUpdateRequestDataAttributes{
EventId: "11111111-2222-3333-4444-555555555555",
IsDeviceTypeSelectedByUser: false,
Start: 0,
},
Id: datadog.PtrString("00000000-0000-0000-0000-000000000001"),
Type: datadogV2.SNAPSHOTUPDATEREQUESTDATATYPE_SNAPSHOTS,
},
}
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.NewRumReplayHeatmapsApi(apiClient)
resp, r, err := api.UpdateReplayHeatmapSnapshot(ctx, "00000000-0000-0000-0000-000000000001", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RumReplayHeatmapsApi.UpdateReplayHeatmapSnapshot`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `RumReplayHeatmapsApi.UpdateReplayHeatmapSnapshot`:\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"// Update replay heatmap snapshot returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumReplayHeatmapsApi;
import com.datadog.api.client.v2.model.Snapshot;
import com.datadog.api.client.v2.model.SnapshotUpdateRequest;
import com.datadog.api.client.v2.model.SnapshotUpdateRequestData;
import com.datadog.api.client.v2.model.SnapshotUpdateRequestDataAttributes;
import com.datadog.api.client.v2.model.SnapshotUpdateRequestDataType;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
RumReplayHeatmapsApi apiInstance = new RumReplayHeatmapsApi(defaultClient);
SnapshotUpdateRequest body =
new SnapshotUpdateRequest()
.data(
new SnapshotUpdateRequestData()
.attributes(
new SnapshotUpdateRequestDataAttributes()
.eventId("11111111-2222-3333-4444-555555555555")
.isDeviceTypeSelectedByUser(false)
.start(0L))
.id("00000000-0000-0000-0000-000000000001")
.type(SnapshotUpdateRequestDataType.SNAPSHOTS));
try {
Snapshot result =
apiInstance.updateReplayHeatmapSnapshot("00000000-0000-0000-0000-000000000001", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RumReplayHeatmapsApi#updateReplayHeatmapSnapshot");
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""""
Update replay heatmap snapshot returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_replay_heatmaps_api import RumReplayHeatmapsApi
from datadog_api_client.v2.model.snapshot_update_request import SnapshotUpdateRequest
from datadog_api_client.v2.model.snapshot_update_request_data import SnapshotUpdateRequestData
from datadog_api_client.v2.model.snapshot_update_request_data_attributes import SnapshotUpdateRequestDataAttributes
from datadog_api_client.v2.model.snapshot_update_request_data_type import SnapshotUpdateRequestDataType
body = SnapshotUpdateRequest(
data=SnapshotUpdateRequestData(
attributes=SnapshotUpdateRequestDataAttributes(
event_id="11111111-2222-3333-4444-555555555555",
is_device_type_selected_by_user=False,
start=0,
),
id="00000000-0000-0000-0000-000000000001",
type=SnapshotUpdateRequestDataType.SNAPSHOTS,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = RumReplayHeatmapsApi(api_client)
response = api_instance.update_replay_heatmap_snapshot(
snapshot_id="00000000-0000-0000-0000-000000000001", 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"# Update replay heatmap snapshot returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::RumReplayHeatmapsAPI.new
body = DatadogAPIClient::V2::SnapshotUpdateRequest.new({
data: DatadogAPIClient::V2::SnapshotUpdateRequestData.new({
attributes: DatadogAPIClient::V2::SnapshotUpdateRequestDataAttributes.new({
event_id: "11111111-2222-3333-4444-555555555555",
is_device_type_selected_by_user: false,
start: 0,
}),
id: "00000000-0000-0000-0000-000000000001",
type: DatadogAPIClient::V2::SnapshotUpdateRequestDataType::SNAPSHOTS,
}),
})
p api_instance.update_replay_heatmap_snapshot("00000000-0000-0000-0000-000000000001", 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"// Update replay heatmap snapshot returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_replay_heatmaps::RumReplayHeatmapsAPI;
use datadog_api_client::datadogV2::model::SnapshotUpdateRequest;
use datadog_api_client::datadogV2::model::SnapshotUpdateRequestData;
use datadog_api_client::datadogV2::model::SnapshotUpdateRequestDataAttributes;
use datadog_api_client::datadogV2::model::SnapshotUpdateRequestDataType;
#[tokio::main]
async fn main() {
let body = SnapshotUpdateRequest::new(
SnapshotUpdateRequestData::new(SnapshotUpdateRequestDataType::SNAPSHOTS)
.attributes(SnapshotUpdateRequestDataAttributes::new(
"11111111-2222-3333-4444-555555555555".to_string(),
false,
0,
))
.id("00000000-0000-0000-0000-000000000001".to_string()),
);
let configuration = datadog::Configuration::new();
let api = RumReplayHeatmapsAPI::with_config(configuration);
let resp = api
.update_replay_heatmap_snapshot("00000000-0000-0000-0000-000000000001".to_string(), 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/**
* Update replay heatmap snapshot returns "OK" 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.RumReplayHeatmapsApi(configuration);
const params: v2.RumReplayHeatmapsApiUpdateReplayHeatmapSnapshotRequest = {
body: {
data: {
attributes: {
eventId: "11111111-2222-3333-4444-555555555555",
isDeviceTypeSelectedByUser: false,
start: 0,
},
id: "00000000-0000-0000-0000-000000000001",
type: "snapshots",
},
},
snapshotId: "00000000-0000-0000-0000-000000000001",
};
apiInstance
.updateReplayHeatmapSnapshot(params)
.then((data: v2.Snapshot) => {
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"