创建应用
curl --request POST \
--url 'https://api.flashcat.cloud/rum/application/create?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "My Web App",
"is_private": false,
"links": {
"enabled": true,
"systems": [
{
"enabled": true,
"event_types": [
"crash",
"error"
],
"icon_color": "#0F766E",
"icon_text": "S3",
"id": "s3-crash-logs",
"name": "S3 Crash Logs",
"url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}"
}
]
},
"team_id": 2477033058131,
"type": "browser"
}
'import requests
url = "https://api.flashcat.cloud/rum/application/create?app_key="
payload = {
"application_name": "My Web App",
"is_private": False,
"links": {
"enabled": True,
"systems": [
{
"enabled": True,
"event_types": ["crash", "error"],
"icon_color": "#0F766E",
"icon_text": "S3",
"id": "s3-crash-logs",
"name": "S3 Crash Logs",
"url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}"
}
]
},
"team_id": 2477033058131,
"type": "browser"
}
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({
application_name: 'My Web App',
is_private: false,
links: {
enabled: true,
systems: [
{
enabled: true,
event_types: ['crash', 'error'],
icon_color: '#0F766E',
icon_text: 'S3',
id: 's3-crash-logs',
name: 'S3 Crash Logs',
url: 'https://s3.example.com/logs?app=${application_id}&trace=${trace_id}'
}
]
},
team_id: 2477033058131,
type: 'browser'
})
};
fetch('https://api.flashcat.cloud/rum/application/create?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/application/create?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([
'application_name' => 'My Web App',
'is_private' => false,
'links' => [
'enabled' => true,
'systems' => [
[
'enabled' => true,
'event_types' => [
'crash',
'error'
],
'icon_color' => '#0F766E',
'icon_text' => 'S3',
'id' => 's3-crash-logs',
'name' => 'S3 Crash Logs',
'url' => 'https://s3.example.com/logs?app=${application_id}&trace=${trace_id}'
]
]
],
'team_id' => 2477033058131,
'type' => 'browser'
]),
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/application/create?app_key="
payload := strings.NewReader("{\n \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\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/application/create?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/application/create?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 \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"application_name": "My Web App",
"client_token": "e090078724855a4ca168c3884880dfbc131"
},
"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": "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"
}应用管理
创建应用
创建新的 RUM 应用,返回生成的 application_id 和 client_token。
POST
/
rum
/
application
/
create
创建应用
curl --request POST \
--url 'https://api.flashcat.cloud/rum/application/create?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"application_name": "My Web App",
"is_private": false,
"links": {
"enabled": true,
"systems": [
{
"enabled": true,
"event_types": [
"crash",
"error"
],
"icon_color": "#0F766E",
"icon_text": "S3",
"id": "s3-crash-logs",
"name": "S3 Crash Logs",
"url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}"
}
]
},
"team_id": 2477033058131,
"type": "browser"
}
'import requests
url = "https://api.flashcat.cloud/rum/application/create?app_key="
payload = {
"application_name": "My Web App",
"is_private": False,
"links": {
"enabled": True,
"systems": [
{
"enabled": True,
"event_types": ["crash", "error"],
"icon_color": "#0F766E",
"icon_text": "S3",
"id": "s3-crash-logs",
"name": "S3 Crash Logs",
"url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}"
}
]
},
"team_id": 2477033058131,
"type": "browser"
}
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({
application_name: 'My Web App',
is_private: false,
links: {
enabled: true,
systems: [
{
enabled: true,
event_types: ['crash', 'error'],
icon_color: '#0F766E',
icon_text: 'S3',
id: 's3-crash-logs',
name: 'S3 Crash Logs',
url: 'https://s3.example.com/logs?app=${application_id}&trace=${trace_id}'
}
]
},
team_id: 2477033058131,
type: 'browser'
})
};
fetch('https://api.flashcat.cloud/rum/application/create?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/application/create?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([
'application_name' => 'My Web App',
'is_private' => false,
'links' => [
'enabled' => true,
'systems' => [
[
'enabled' => true,
'event_types' => [
'crash',
'error'
],
'icon_color' => '#0F766E',
'icon_text' => 'S3',
'id' => 's3-crash-logs',
'name' => 'S3 Crash Logs',
'url' => 'https://s3.example.com/logs?app=${application_id}&trace=${trace_id}'
]
]
],
'team_id' => 2477033058131,
'type' => 'browser'
]),
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/application/create?app_key="
payload := strings.NewReader("{\n \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\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/application/create?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/rum/application/create?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 \"application_name\": \"My Web App\",\n \"is_private\": false,\n \"links\": {\n \"enabled\": true,\n \"systems\": [\n {\n \"enabled\": true,\n \"event_types\": [\n \"crash\",\n \"error\"\n ],\n \"icon_color\": \"#0F766E\",\n \"icon_text\": \"S3\",\n \"id\": \"s3-crash-logs\",\n \"name\": \"S3 Crash Logs\",\n \"url\": \"https://s3.example.com/logs?app=${application_id}&trace=${trace_id}\"\n }\n ]\n },\n \"team_id\": 2477033058131,\n \"type\": \"browser\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"application_id": "qLpu24Dz4CAzWsESPbJYWA",
"application_name": "My Web App",
"client_token": "e090078724855a4ca168c3884880dfbc131"
},
"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": "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"
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 300 次/分钟;20 次/秒 |
| 权限要求 | 应用管理(rum) |
使用说明
type须为以下之一:browser、ios、android、react-native、flutter、kotlin-multiplatform、roku、unity、miniprogram、harmony、electron。client_token由服务端生成,用于初始化 RUM SDK;之后也可通过POST /rum/application/info再次获取。- 传入
tracing时,即使enabled为false,也必须提供open_type(popup或tab)和以http/https开头的endpoint。 links.systems[].url必须以http或https开头;每个系统都需要name和至少一个event_types。alerting.delivery_mode为oncall(Flashduty 云端默认值)时,服务端会创建或复用账户的 RUM 告警集成,并在alerting.integration_id中返回其 ID。- 服务端不校验
team_id是否为调用者所在的团队。 - 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。
授权
请求体
application/json
创建 RUM 应用的参数。
平台标识:
| 值 | 含义 |
|---|---|
browser | 浏览器 Web 应用(JavaScript SDK) |
ios | 苹果 iOS 应用 |
android | Android 应用 |
react-native | React Native 应用 |
flutter | Flutter 应用 |
kotlin-multiplatform | Kotlin Multiplatform 应用 |
roku | Roku 频道应用 |
unity | Unity 应用 |
miniprogram | 微信小程序 |
harmony | 鸿蒙 HarmonyOS 应用 |
electron | Electron 桌面应用 |
可用选项:
browser, ios, android, react-native, flutter, kotlin-multiplatform, roku, unity, miniprogram, harmony, electron 此页面对您有帮助吗?