更新公共集成
curl --request POST \
--url 'https://api.flashcat.cloud/integration/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"integration_id": 6113996590131,
"name": "Prod metrics alerts (primary)",
"team_id": 1467226103121,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"is_test": true
}
'import requests
url = "https://api.flashcat.cloud/integration/update?app_key="
payload = {
"integration_id": 6113996590131,
"name": "Prod metrics alerts (primary)",
"team_id": 1467226103121,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"is_test": True
}
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({
integration_id: 6113996590131,
name: 'Prod metrics alerts (primary)',
team_id: 1467226103121,
settings: {field_mapping: {}, value_mapping: {}},
is_test: true
})
};
fetch('https://api.flashcat.cloud/integration/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/integration/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([
'integration_id' => 6113996590131,
'name' => 'Prod metrics alerts (primary)',
'team_id' => 1467226103121,
'settings' => [
'field_mapping' => [
],
'value_mapping' => [
]
],
'is_test' => true
]),
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/integration/update?app_key="
payload := strings.NewReader("{\n \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\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/integration/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/integration/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 \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"integration_id": 6113996590131,
"team_id": 1467226103121,
"plugin_type": "standard.alert",
"plugin_type_name": "Standard Alert",
"category": "event.alert",
"name": "Prod metrics alerts (primary)",
"description": "Alerts pushed by the production Prometheus stack",
"status": "enabled",
"ref_id": "a_100",
"created_at": 1775116800,
"updated_at": 1775298600,
"last_time": 1775298600,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"editable": true,
"creator_id": 1467226103999,
"updated_by": 1467226103999,
"no_editable": false,
"plugin_id": 9,
"integration_key": "0123456789abcdef0123456789abcdef100",
"test": {
"success": true,
"message": ""
}
}
}{
"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."
}
}公共集成
更新公共集成
更新集成的名称、描述、所属团队或配置。
POST
/
integration
/
update
更新公共集成
curl --request POST \
--url 'https://api.flashcat.cloud/integration/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"integration_id": 6113996590131,
"name": "Prod metrics alerts (primary)",
"team_id": 1467226103121,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"is_test": true
}
'import requests
url = "https://api.flashcat.cloud/integration/update?app_key="
payload = {
"integration_id": 6113996590131,
"name": "Prod metrics alerts (primary)",
"team_id": 1467226103121,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"is_test": True
}
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({
integration_id: 6113996590131,
name: 'Prod metrics alerts (primary)',
team_id: 1467226103121,
settings: {field_mapping: {}, value_mapping: {}},
is_test: true
})
};
fetch('https://api.flashcat.cloud/integration/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/integration/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([
'integration_id' => 6113996590131,
'name' => 'Prod metrics alerts (primary)',
'team_id' => 1467226103121,
'settings' => [
'field_mapping' => [
],
'value_mapping' => [
]
],
'is_test' => true
]),
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/integration/update?app_key="
payload := strings.NewReader("{\n \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\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/integration/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/integration/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 \"integration_id\": 6113996590131,\n \"name\": \"Prod metrics alerts (primary)\",\n \"team_id\": 1467226103121,\n \"settings\": {\n \"field_mapping\": {},\n \"value_mapping\": {}\n },\n \"is_test\": true\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"integration_id": 6113996590131,
"team_id": 1467226103121,
"plugin_type": "standard.alert",
"plugin_type_name": "Standard Alert",
"category": "event.alert",
"name": "Prod metrics alerts (primary)",
"description": "Alerts pushed by the production Prometheus stack",
"status": "enabled",
"ref_id": "a_100",
"created_at": 1775116800,
"updated_at": 1775298600,
"last_time": 1775298600,
"settings": {
"field_mapping": {},
"value_mapping": {}
},
"editable": true,
"creator_id": 1467226103999,
"updated_by": 1467226103999,
"no_editable": false,
"plugin_id": 9,
"integration_key": "0123456789abcdef0123456789abcdef100",
"test": {
"success": true,
"message": ""
}
}
}{
"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."
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 300 次/分钟;20 次/秒 |
| 权限要求 | 集成中心管理(on-call) |
使用说明
- 仅发送的字段会被修改,未发送的字段保持原值。
- 提交
settings会替换配置;已识别的敏感字段不传或传******时保留原值。保留已存密钥的同时修改它的发送目标(如endpoint、url、数据库主机或端口、IM 接口地址)会被拒绝,需要随新目标重新填写密钥;没有已存值的字段传******也会被拒绝。清空 Headers 请传headers: {};清空 Body 请使用该集成类型的显式空值。 - 同时提交
settings与is_test: true可获得插件测试结果,返回的 settings 中密钥同样返回******。 - 处理期间若有其他请求修改了同一集成的配置,本次调用返回
RequestLocked,重试即可。当前套餐已不包含该集成类型时返回NoLicense。 - 这些接口仅管理公共(账户级)集成,不管理协作空间专属集成。
- 写操作还需对象权限:主体账户、管理员、创建者或所属团队成员可操作;未设置团队时,拥有集成中心管理权限的成员可操作,只读集成不可修改。
- 每次调用都会记录到账户审计日志。
授权
请求体
application/json
更新集成的请求体;仅发送的字段会被修改。
此页面对您有帮助吗?