更新协作空间
curl --request POST \
--url 'https://api.flashcat.cloud/channel/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 3521074710131,
"channel_name": "Production Alerts (v2)",
"description": "Updated description"
}
'import requests
url = "https://api.flashcat.cloud/channel/update?app_key="
payload = {
"channel_id": 3521074710131,
"channel_name": "Production Alerts (v2)",
"description": "Updated description"
}
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({
channel_id: 3521074710131,
channel_name: 'Production Alerts (v2)',
description: 'Updated description'
})
};
fetch('https://api.flashcat.cloud/channel/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/channel/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([
'channel_id' => 3521074710131,
'channel_name' => 'Production Alerts (v2)',
'description' => 'Updated description'
]),
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/channel/update?app_key="
payload := strings.NewReader("{\n \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\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/channel/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/channel/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 \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"external_report_token": ""
}
}{
"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
/
channel
/
update
更新协作空间
curl --request POST \
--url 'https://api.flashcat.cloud/channel/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"channel_id": 3521074710131,
"channel_name": "Production Alerts (v2)",
"description": "Updated description"
}
'import requests
url = "https://api.flashcat.cloud/channel/update?app_key="
payload = {
"channel_id": 3521074710131,
"channel_name": "Production Alerts (v2)",
"description": "Updated description"
}
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({
channel_id: 3521074710131,
channel_name: 'Production Alerts (v2)',
description: 'Updated description'
})
};
fetch('https://api.flashcat.cloud/channel/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/channel/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([
'channel_id' => 3521074710131,
'channel_name' => 'Production Alerts (v2)',
'description' => 'Updated description'
]),
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/channel/update?app_key="
payload := strings.NewReader("{\n \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\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/channel/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/channel/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 \"channel_id\": 3521074710131,\n \"channel_name\": \"Production Alerts (v2)\",\n \"description\": \"Updated description\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"external_report_token": ""
}
}{
"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) |
使用说明
- 未传或为
null的字段保持原值。group、flapping、event_group一旦传入即整体替换原配置。 - 传
managing_team_ids: []可清空管理团队。 auto_resolve_mode只有与auto_resolve_timeout一起传入时才生效;只传auto_resolve_timeout时,模式会重置为trigger。- 每次把
is_external_report_enabled设为true都会生成新的external_report_token,旧令牌随即失效;设为false会清空令牌。 channel_name与其他协作空间重名时返回InvalidParameter;group.method为p或i但许可证不足时返回NoLicense。- 调用者还必须拥有该协作空间的编辑权:账户所有者或管理员、协作空间创建者,或其管理团队成员(
managing_team_ids为空时为所属团队成员),否则返回AccessDenied。 - 每次调用都会记录到账户审计日志。
授权
请求体
application/json
更新协作空间所需参数,仅传入的字段会被更新。
响应
成功
成功响应结构。2xx 响应中 request_id 标识本次调用(同时出现在 Flashcat-Request-Id 响应头中),data 为接口业务 payload。失败响应使用不同结构,参见 ErrorResponse。
此页面对您有帮助吗?