curl --request POST \
--url 'https://api.flashcat.cloud/rum/dashboard/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": false,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": true,
"variable_mappings": {
"page": {
"column": "view.url_path",
"source": "row_column"
}
}
}
],
"options": {
"dense": true
},
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": {
"sparkline": true
},
"reducer": "max",
"unit": "milliseconds",
"value_fields": [
"view.loading_time"
]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": {
"kind": "all"
},
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": true,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": [
"/checkout"
]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": false,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"expected_revision": 3,
"message": "Raise the p95 threshold",
"schema_version": "dashboard.v1"
}
'import requests
url = "https://api.flashcat.cloud/rum/dashboard/update?app_key="
payload = {
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": False,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": True,
"variable_mappings": { "page": {
"column": "view.url_path",
"source": "row_column"
} }
}
],
"options": { "dense": True },
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": { "sparkline": True },
"reducer": "max",
"unit": "milliseconds",
"value_fields": ["view.loading_time"]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": { "kind": "all" },
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": True,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": ["/checkout"]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": False,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"expected_revision": 3,
"message": "Raise the p95 threshold",
"schema_version": "dashboard.v1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard_id: '0192f3a4-5b6c-7d8e-9f01-234567890abc',
definition: {
default_time_range: {from: 'now-1h', to: 'now'},
description: 'Loading time and error rate of the storefront.',
refresh_interval: '1m',
tabs: [
{
id: '0192f3a4-5b6c-7d8e-9f01-234567890abd',
sections: [
{
collapsed: false,
id: '0192f3a4-5b6c-7d8e-9f01-234567890abe',
panels: [
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
grid: {h: 8, w: 16, x: 0, y: 4},
id: '0192f3a4-5b6c-7d8e-9f01-234567890ac0',
queries: [
{
query: {
args: {
agg: 'p95',
application_id: 'qLpu24Dz4CAzWsESPbJYWA',
draw_style: 'bar',
field: 'view.loading_time',
group_by: 'view.url_path',
limit: '20',
scope: 'view'
},
expr: 'page:${page}',
min_step_seconds: 60,
mode: 'range'
},
ref_id: 'A'
}
],
title: 'Slowest pages by p95',
viz_config: {
column_options: {
A: {
display_name: 'p95',
threshold: {critical: 3000, mode: 'higher_is_worse', warning: 1500},
threshold_display: 'background',
unit: 'milliseconds'
},
'view.url_path': {display_name: 'Page', width_px: 320}
},
kind: 'table',
link_columns: [
{
dashboard_id: '0192f3a4-5b6c-7d8e-9f01-234567890ac1',
pass_time: true,
variable_mappings: {page: {column: 'view.url_path', source: 'row_column'}}
}
],
options: {dense: true},
sort: [{direction: 'desc', field: 'A'}]
}
}
],
title: 'Slowest pages'
}
],
title: 'Overview',
top_panels: [
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
grid: {h: 4, w: 8, x: 0, y: 0},
id: '0192f3a4-5b6c-7d8e-9f01-234567890abf',
queries: [
{
legend_alias: 'p95 loading time',
query: {
args: {
agg: 'p95',
application_id: 'qLpu24Dz4CAzWsESPbJYWA',
field: 'view.loading_time',
scope: 'view'
},
expr: 'env:${env}',
min_step_seconds: 60,
mode: 'range'
},
ref_id: 'A'
}
],
title: 'p95 loading time',
viz_config: {
decimals: 0,
kind: 'stat',
options: {sparkline: true},
reducer: 'max',
unit: 'milliseconds',
value_fields: ['view.loading_time']
}
}
]
}
],
title: 'Web performance overview',
variables: [
{
default: {kind: 'all'},
kind: 'custom',
label: 'Environment',
name: 'env',
options: [{text: 'Production', value: 'prod'}, {text: 'Staging', value: 'staging'}],
selection: {include_all: true, mode: 'multi'}
},
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
default: {kind: 'values', values: ['/checkout']},
kind: 'query',
label: 'Page',
name: 'page',
refresh: 'on_dashboard_load',
selection: {include_all: false, mode: 'single'},
variable_query: {field: 'view.url_path', kind: 'rum_field'}
}
]
},
expected_revision: 3,
message: 'Raise the p95 threshold',
schema_version: 'dashboard.v1'
})
};
fetch('https://api.flashcat.cloud/rum/dashboard/update?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/rum/dashboard/update?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dashboard_id' => '0192f3a4-5b6c-7d8e-9f01-234567890abc',
'definition' => [
'default_time_range' => [
'from' => 'now-1h',
'to' => 'now'
],
'description' => 'Loading time and error rate of the storefront.',
'refresh_interval' => '1m',
'tabs' => [
[
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abd',
'sections' => [
[
'collapsed' => false,
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abe',
'panels' => [
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'grid' => [
'h' => 8,
'w' => 16,
'x' => 0,
'y' => 4
],
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890ac0',
'queries' => [
[
'query' => [
'args' => [
'agg' => 'p95',
'application_id' => 'qLpu24Dz4CAzWsESPbJYWA',
'draw_style' => 'bar',
'field' => 'view.loading_time',
'group_by' => 'view.url_path',
'limit' => '20',
'scope' => 'view'
],
'expr' => 'page:${page}',
'min_step_seconds' => 60,
'mode' => 'range'
],
'ref_id' => 'A'
]
],
'title' => 'Slowest pages by p95',
'viz_config' => [
'column_options' => [
'A' => [
'display_name' => 'p95',
'threshold' => [
'critical' => 3000,
'mode' => 'higher_is_worse',
'warning' => 1500
],
'threshold_display' => 'background',
'unit' => 'milliseconds'
],
'view.url_path' => [
'display_name' => 'Page',
'width_px' => 320
]
],
'kind' => 'table',
'link_columns' => [
[
'dashboard_id' => '0192f3a4-5b6c-7d8e-9f01-234567890ac1',
'pass_time' => true,
'variable_mappings' => [
'page' => [
'column' => 'view.url_path',
'source' => 'row_column'
]
]
]
],
'options' => [
'dense' => true
],
'sort' => [
[
'direction' => 'desc',
'field' => 'A'
]
]
]
]
],
'title' => 'Slowest pages'
]
],
'title' => 'Overview',
'top_panels' => [
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'grid' => [
'h' => 4,
'w' => 8,
'x' => 0,
'y' => 0
],
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abf',
'queries' => [
[
'legend_alias' => 'p95 loading time',
'query' => [
'args' => [
'agg' => 'p95',
'application_id' => 'qLpu24Dz4CAzWsESPbJYWA',
'field' => 'view.loading_time',
'scope' => 'view'
],
'expr' => 'env:${env}',
'min_step_seconds' => 60,
'mode' => 'range'
],
'ref_id' => 'A'
]
],
'title' => 'p95 loading time',
'viz_config' => [
'decimals' => 0,
'kind' => 'stat',
'options' => [
'sparkline' => true
],
'reducer' => 'max',
'unit' => 'milliseconds',
'value_fields' => [
'view.loading_time'
]
]
]
]
]
],
'title' => 'Web performance overview',
'variables' => [
[
'default' => [
'kind' => 'all'
],
'kind' => 'custom',
'label' => 'Environment',
'name' => 'env',
'options' => [
[
'text' => 'Production',
'value' => 'prod'
],
[
'text' => 'Staging',
'value' => 'staging'
]
],
'selection' => [
'include_all' => true,
'mode' => 'multi'
]
],
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'default' => [
'kind' => 'values',
'values' => [
'/checkout'
]
],
'kind' => 'query',
'label' => 'Page',
'name' => 'page',
'refresh' => 'on_dashboard_load',
'selection' => [
'include_all' => false,
'mode' => 'single'
],
'variable_query' => [
'field' => 'view.url_path',
'kind' => 'rum_field'
]
]
]
],
'expected_revision' => 3,
'message' => 'Raise the p95 threshold',
'schema_version' => 'dashboard.v1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/rum/dashboard/update?app_key="
payload := strings.NewReader("{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/rum/dashboard/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/dashboard/update?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"changed": true,
"resource": {
"created_at": 1792401120000,
"created_by": {
"id": 2477033058131,
"name": "Alex Chen"
},
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": false,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": true,
"variable_mappings": {
"page": {
"column": "view.url_path",
"source": "row_column"
}
}
}
],
"options": {
"dense": true
},
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": {
"sparkline": true
},
"reducer": "max",
"unit": "milliseconds",
"value_fields": [
"view.loading_time"
]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": {
"kind": "all"
},
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": true,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": [
"/checkout"
]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": false,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"revision": 4,
"schema_version": "dashboard.v1",
"updated_at": 1792404240000,
"updated_by": {
"id": 2477033058177,
"name": "Mei Lin"
}
}
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "AccessDenied",
"message": "Access Denied."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}Update dashboard
Replace a dashboard’s definition under an expected-revision check.
curl --request POST \
--url 'https://api.flashcat.cloud/rum/dashboard/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": false,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": true,
"variable_mappings": {
"page": {
"column": "view.url_path",
"source": "row_column"
}
}
}
],
"options": {
"dense": true
},
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": {
"sparkline": true
},
"reducer": "max",
"unit": "milliseconds",
"value_fields": [
"view.loading_time"
]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": {
"kind": "all"
},
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": true,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": [
"/checkout"
]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": false,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"expected_revision": 3,
"message": "Raise the p95 threshold",
"schema_version": "dashboard.v1"
}
'import requests
url = "https://api.flashcat.cloud/rum/dashboard/update?app_key="
payload = {
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": False,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": True,
"variable_mappings": { "page": {
"column": "view.url_path",
"source": "row_column"
} }
}
],
"options": { "dense": True },
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": { "sparkline": True },
"reducer": "max",
"unit": "milliseconds",
"value_fields": ["view.loading_time"]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": { "kind": "all" },
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": True,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": ["/checkout"]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": False,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"expected_revision": 3,
"message": "Raise the p95 threshold",
"schema_version": "dashboard.v1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard_id: '0192f3a4-5b6c-7d8e-9f01-234567890abc',
definition: {
default_time_range: {from: 'now-1h', to: 'now'},
description: 'Loading time and error rate of the storefront.',
refresh_interval: '1m',
tabs: [
{
id: '0192f3a4-5b6c-7d8e-9f01-234567890abd',
sections: [
{
collapsed: false,
id: '0192f3a4-5b6c-7d8e-9f01-234567890abe',
panels: [
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
grid: {h: 8, w: 16, x: 0, y: 4},
id: '0192f3a4-5b6c-7d8e-9f01-234567890ac0',
queries: [
{
query: {
args: {
agg: 'p95',
application_id: 'qLpu24Dz4CAzWsESPbJYWA',
draw_style: 'bar',
field: 'view.loading_time',
group_by: 'view.url_path',
limit: '20',
scope: 'view'
},
expr: 'page:${page}',
min_step_seconds: 60,
mode: 'range'
},
ref_id: 'A'
}
],
title: 'Slowest pages by p95',
viz_config: {
column_options: {
A: {
display_name: 'p95',
threshold: {critical: 3000, mode: 'higher_is_worse', warning: 1500},
threshold_display: 'background',
unit: 'milliseconds'
},
'view.url_path': {display_name: 'Page', width_px: 320}
},
kind: 'table',
link_columns: [
{
dashboard_id: '0192f3a4-5b6c-7d8e-9f01-234567890ac1',
pass_time: true,
variable_mappings: {page: {column: 'view.url_path', source: 'row_column'}}
}
],
options: {dense: true},
sort: [{direction: 'desc', field: 'A'}]
}
}
],
title: 'Slowest pages'
}
],
title: 'Overview',
top_panels: [
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
grid: {h: 4, w: 8, x: 0, y: 0},
id: '0192f3a4-5b6c-7d8e-9f01-234567890abf',
queries: [
{
legend_alias: 'p95 loading time',
query: {
args: {
agg: 'p95',
application_id: 'qLpu24Dz4CAzWsESPbJYWA',
field: 'view.loading_time',
scope: 'view'
},
expr: 'env:${env}',
min_step_seconds: 60,
mode: 'range'
},
ref_id: 'A'
}
],
title: 'p95 loading time',
viz_config: {
decimals: 0,
kind: 'stat',
options: {sparkline: true},
reducer: 'max',
unit: 'milliseconds',
value_fields: ['view.loading_time']
}
}
]
}
],
title: 'Web performance overview',
variables: [
{
default: {kind: 'all'},
kind: 'custom',
label: 'Environment',
name: 'env',
options: [{text: 'Production', value: 'prod'}, {text: 'Staging', value: 'staging'}],
selection: {include_all: true, mode: 'multi'}
},
{
datasource_ref: {datasource_type: 'rum', kind: 'fixed'},
default: {kind: 'values', values: ['/checkout']},
kind: 'query',
label: 'Page',
name: 'page',
refresh: 'on_dashboard_load',
selection: {include_all: false, mode: 'single'},
variable_query: {field: 'view.url_path', kind: 'rum_field'}
}
]
},
expected_revision: 3,
message: 'Raise the p95 threshold',
schema_version: 'dashboard.v1'
})
};
fetch('https://api.flashcat.cloud/rum/dashboard/update?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/rum/dashboard/update?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dashboard_id' => '0192f3a4-5b6c-7d8e-9f01-234567890abc',
'definition' => [
'default_time_range' => [
'from' => 'now-1h',
'to' => 'now'
],
'description' => 'Loading time and error rate of the storefront.',
'refresh_interval' => '1m',
'tabs' => [
[
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abd',
'sections' => [
[
'collapsed' => false,
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abe',
'panels' => [
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'grid' => [
'h' => 8,
'w' => 16,
'x' => 0,
'y' => 4
],
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890ac0',
'queries' => [
[
'query' => [
'args' => [
'agg' => 'p95',
'application_id' => 'qLpu24Dz4CAzWsESPbJYWA',
'draw_style' => 'bar',
'field' => 'view.loading_time',
'group_by' => 'view.url_path',
'limit' => '20',
'scope' => 'view'
],
'expr' => 'page:${page}',
'min_step_seconds' => 60,
'mode' => 'range'
],
'ref_id' => 'A'
]
],
'title' => 'Slowest pages by p95',
'viz_config' => [
'column_options' => [
'A' => [
'display_name' => 'p95',
'threshold' => [
'critical' => 3000,
'mode' => 'higher_is_worse',
'warning' => 1500
],
'threshold_display' => 'background',
'unit' => 'milliseconds'
],
'view.url_path' => [
'display_name' => 'Page',
'width_px' => 320
]
],
'kind' => 'table',
'link_columns' => [
[
'dashboard_id' => '0192f3a4-5b6c-7d8e-9f01-234567890ac1',
'pass_time' => true,
'variable_mappings' => [
'page' => [
'column' => 'view.url_path',
'source' => 'row_column'
]
]
]
],
'options' => [
'dense' => true
],
'sort' => [
[
'direction' => 'desc',
'field' => 'A'
]
]
]
]
],
'title' => 'Slowest pages'
]
],
'title' => 'Overview',
'top_panels' => [
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'grid' => [
'h' => 4,
'w' => 8,
'x' => 0,
'y' => 0
],
'id' => '0192f3a4-5b6c-7d8e-9f01-234567890abf',
'queries' => [
[
'legend_alias' => 'p95 loading time',
'query' => [
'args' => [
'agg' => 'p95',
'application_id' => 'qLpu24Dz4CAzWsESPbJYWA',
'field' => 'view.loading_time',
'scope' => 'view'
],
'expr' => 'env:${env}',
'min_step_seconds' => 60,
'mode' => 'range'
],
'ref_id' => 'A'
]
],
'title' => 'p95 loading time',
'viz_config' => [
'decimals' => 0,
'kind' => 'stat',
'options' => [
'sparkline' => true
],
'reducer' => 'max',
'unit' => 'milliseconds',
'value_fields' => [
'view.loading_time'
]
]
]
]
]
],
'title' => 'Web performance overview',
'variables' => [
[
'default' => [
'kind' => 'all'
],
'kind' => 'custom',
'label' => 'Environment',
'name' => 'env',
'options' => [
[
'text' => 'Production',
'value' => 'prod'
],
[
'text' => 'Staging',
'value' => 'staging'
]
],
'selection' => [
'include_all' => true,
'mode' => 'multi'
]
],
[
'datasource_ref' => [
'datasource_type' => 'rum',
'kind' => 'fixed'
],
'default' => [
'kind' => 'values',
'values' => [
'/checkout'
]
],
'kind' => 'query',
'label' => 'Page',
'name' => 'page',
'refresh' => 'on_dashboard_load',
'selection' => [
'include_all' => false,
'mode' => 'single'
],
'variable_query' => [
'field' => 'view.url_path',
'kind' => 'rum_field'
]
]
]
],
'expected_revision' => 3,
'message' => 'Raise the p95 threshold',
'schema_version' => 'dashboard.v1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/rum/dashboard/update?app_key="
payload := strings.NewReader("{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/rum/dashboard/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/dashboard/update?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abc\",\n \"definition\": {\n \"default_time_range\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"description\": \"Loading time and error rate of the storefront.\",\n \"refresh_interval\": \"1m\",\n \"tabs\": [\n {\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abd\",\n \"sections\": [\n {\n \"collapsed\": false,\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abe\",\n \"panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 8,\n \"w\": 16,\n \"x\": 0,\n \"y\": 4\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac0\",\n \"queries\": [\n {\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"draw_style\": \"bar\",\n \"field\": \"view.loading_time\",\n \"group_by\": \"view.url_path\",\n \"limit\": \"20\",\n \"scope\": \"view\"\n },\n \"expr\": \"page:${page}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"Slowest pages by p95\",\n \"viz_config\": {\n \"column_options\": {\n \"A\": {\n \"display_name\": \"p95\",\n \"threshold\": {\n \"critical\": 3000,\n \"mode\": \"higher_is_worse\",\n \"warning\": 1500\n },\n \"threshold_display\": \"background\",\n \"unit\": \"milliseconds\"\n },\n \"view.url_path\": {\n \"display_name\": \"Page\",\n \"width_px\": 320\n }\n },\n \"kind\": \"table\",\n \"link_columns\": [\n {\n \"dashboard_id\": \"0192f3a4-5b6c-7d8e-9f01-234567890ac1\",\n \"pass_time\": true,\n \"variable_mappings\": {\n \"page\": {\n \"column\": \"view.url_path\",\n \"source\": \"row_column\"\n }\n }\n }\n ],\n \"options\": {\n \"dense\": true\n },\n \"sort\": [\n {\n \"direction\": \"desc\",\n \"field\": \"A\"\n }\n ]\n }\n }\n ],\n \"title\": \"Slowest pages\"\n }\n ],\n \"title\": \"Overview\",\n \"top_panels\": [\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"grid\": {\n \"h\": 4,\n \"w\": 8,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": \"0192f3a4-5b6c-7d8e-9f01-234567890abf\",\n \"queries\": [\n {\n \"legend_alias\": \"p95 loading time\",\n \"query\": {\n \"args\": {\n \"agg\": \"p95\",\n \"application_id\": \"qLpu24Dz4CAzWsESPbJYWA\",\n \"field\": \"view.loading_time\",\n \"scope\": \"view\"\n },\n \"expr\": \"env:${env}\",\n \"min_step_seconds\": 60,\n \"mode\": \"range\"\n },\n \"ref_id\": \"A\"\n }\n ],\n \"title\": \"p95 loading time\",\n \"viz_config\": {\n \"decimals\": 0,\n \"kind\": \"stat\",\n \"options\": {\n \"sparkline\": true\n },\n \"reducer\": \"max\",\n \"unit\": \"milliseconds\",\n \"value_fields\": [\n \"view.loading_time\"\n ]\n }\n }\n ]\n }\n ],\n \"title\": \"Web performance overview\",\n \"variables\": [\n {\n \"default\": {\n \"kind\": \"all\"\n },\n \"kind\": \"custom\",\n \"label\": \"Environment\",\n \"name\": \"env\",\n \"options\": [\n {\n \"text\": \"Production\",\n \"value\": \"prod\"\n },\n {\n \"text\": \"Staging\",\n \"value\": \"staging\"\n }\n ],\n \"selection\": {\n \"include_all\": true,\n \"mode\": \"multi\"\n }\n },\n {\n \"datasource_ref\": {\n \"datasource_type\": \"rum\",\n \"kind\": \"fixed\"\n },\n \"default\": {\n \"kind\": \"values\",\n \"values\": [\n \"/checkout\"\n ]\n },\n \"kind\": \"query\",\n \"label\": \"Page\",\n \"name\": \"page\",\n \"refresh\": \"on_dashboard_load\",\n \"selection\": {\n \"include_all\": false,\n \"mode\": \"single\"\n },\n \"variable_query\": {\n \"field\": \"view.url_path\",\n \"kind\": \"rum_field\"\n }\n }\n ]\n },\n \"expected_revision\": 3,\n \"message\": \"Raise the p95 threshold\",\n \"schema_version\": \"dashboard.v1\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"changed": true,
"resource": {
"created_at": 1792401120000,
"created_by": {
"id": 2477033058131,
"name": "Alex Chen"
},
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890abc",
"definition": {
"default_time_range": {
"from": "now-1h",
"to": "now"
},
"description": "Loading time and error rate of the storefront.",
"refresh_interval": "1m",
"tabs": [
{
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abd",
"sections": [
{
"collapsed": false,
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abe",
"panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 8,
"w": 16,
"x": 0,
"y": 4
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890ac0",
"queries": [
{
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"draw_style": "bar",
"field": "view.loading_time",
"group_by": "view.url_path",
"limit": "20",
"scope": "view"
},
"expr": "page:${page}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "Slowest pages by p95",
"viz_config": {
"column_options": {
"A": {
"display_name": "p95",
"threshold": {
"critical": 3000,
"mode": "higher_is_worse",
"warning": 1500
},
"threshold_display": "background",
"unit": "milliseconds"
},
"view.url_path": {
"display_name": "Page",
"width_px": 320
}
},
"kind": "table",
"link_columns": [
{
"dashboard_id": "0192f3a4-5b6c-7d8e-9f01-234567890ac1",
"pass_time": true,
"variable_mappings": {
"page": {
"column": "view.url_path",
"source": "row_column"
}
}
}
],
"options": {
"dense": true
},
"sort": [
{
"direction": "desc",
"field": "A"
}
]
}
}
],
"title": "Slowest pages"
}
],
"title": "Overview",
"top_panels": [
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"grid": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"id": "0192f3a4-5b6c-7d8e-9f01-234567890abf",
"queries": [
{
"legend_alias": "p95 loading time",
"query": {
"args": {
"agg": "p95",
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"field": "view.loading_time",
"scope": "view"
},
"expr": "env:${env}",
"min_step_seconds": 60,
"mode": "range"
},
"ref_id": "A"
}
],
"title": "p95 loading time",
"viz_config": {
"decimals": 0,
"kind": "stat",
"options": {
"sparkline": true
},
"reducer": "max",
"unit": "milliseconds",
"value_fields": [
"view.loading_time"
]
}
}
]
}
],
"title": "Web performance overview",
"variables": [
{
"default": {
"kind": "all"
},
"kind": "custom",
"label": "Environment",
"name": "env",
"options": [
{
"text": "Production",
"value": "prod"
},
{
"text": "Staging",
"value": "staging"
}
],
"selection": {
"include_all": true,
"mode": "multi"
}
},
{
"datasource_ref": {
"datasource_type": "rum",
"kind": "fixed"
},
"default": {
"kind": "values",
"values": [
"/checkout"
]
},
"kind": "query",
"label": "Page",
"name": "page",
"refresh": "on_dashboard_load",
"selection": {
"include_all": false,
"mode": "single"
},
"variable_query": {
"field": "view.url_path",
"kind": "rum_field"
}
}
]
},
"revision": 4,
"schema_version": "dashboard.v1",
"updated_at": 1792404240000,
"updated_by": {
"id": 2477033058177,
"name": "Mei Lin"
}
}
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "AccessDenied",
"message": "Access Denied."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InvalidParameter",
"message": "The specified parameter template_id is not valid."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}{
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
},
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
}Restrictions
| Aspect | Value |
|---|---|
| Rate limits | 300 requests/minute; 20 requests/second per account |
| Permissions | Dashboards Manage (rum) |
Usage
- The definition is replaced whole; there is no partial update.
expected_revisionmust equal the current revision, otherwise the call fails with HTTP 409DashboardRevisionConflict. Re-read withPOST /rum/dashboard/getand retry.- An unchanged definition returns
changed: falseand keeps the current revision. - Each change stores a revision (up to 20 are kept) with the optional
message. - A dashboard that does not exist returns HTTP 404
DashboardNotFound; one in the trash returns HTTP 410DashboardDeleted. - A body over 2 MiB, a definition over 1 MiB, or exceeding a count limit returns HTTP 413
EntityTooLarge; aschema_versionother thandashboard.v1returns HTTP 422UnsupportedSchemaVersion. - Applications are verified as on create.
Authorizations
APP Key created in the Flashduty console under My → APP Key. Send it as the app_key query parameter or in the Fd-App-Key request header. Its effective access is the intersection of the key's permission scope and the creator's current role permissions. Keep it secret.
Body
Update request. expected_revision makes the write conditional: the update fails with DashboardRevisionConflict when the dashboard has moved on.
Dashboard ID, a canonical UUIDv7.
^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Wire schema of the definition. Must be dashboard.v1.
dashboard.v1 Revision the caller last read. Must be at least 1.
x >= 1The dashboard body: title, default time range, variables, and tabs. A dashboard is capped at 10 tabs, 100 panels and 300 queries. A tab holds at most 30 panels and 100 queries, top panels and sections together.
Show child attributes
Show child attributes
Optional change message stored with the revision, at most 1024 characters.
1024Response
Success
Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.
Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.
"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
Result of an update. changed is false when the submitted definition matched the stored one, in which case resource is still returned.
Show child attributes
Show child attributes
Was this page helpful?