You need to enable JavaScript to run this app.
导航

UpdateContact

最近更新时间2024.04.19 11:53:54

首次发布时间2023.06.30 15:23:34

更新告警联系人信息。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=UpdateContact&Version=2021-03-03

请求参数

参数名称类型是否必选示例值描述
ActionStringUpdateContact公共参数,本接口值:UpdateContact。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
IdString4a337d5b-0959-4cc7-a3ea-2f71332d4ff3联系人 ID。

Name

String

test

联系人名称。

  • 支持大小写字母、中文、数字、中划线或下划线。
  • 不能以数字、中划线、下划线或其他特殊字符开头。
  • 长度小于 128 个字符。
  • 账户内唯一。
EmailStringtest@123.com联系人邮箱,需为合法邮箱字段。
WebhookObject Webhook联系人通用 Webhook。
ContactGroupIdsArray of String["f9626b5a-0c9e-420e-b6e5-4c66b84f080d"]联系人所属联系人组 ID。
LarkBotWebhookObject LarkBotWebhook-联系人飞书群组机器人 Webhook。
DingTalkBotWebhookObject DingTalkBotWebhook-联系人钉钉群组机器人 Webhook。

Webhook

参数名称类型是否必选示例值描述
AddressStringhttps://www.bytedance.com/通用 Webhook 地址。

Token

String

3KSxxx

通用 Webhook token。
不能单独配置,需要与通用 Webhook 地址搭配使用。

LarkBotWebhook

参数名称类型是否必选示例值描述
AddressStringhttps://open.feishu.cn/open-apis/bot/v2/hook/xxx飞书群组机器人 Webhook 地址,请参见 官方文档

SecretKey

String

6KKxxx

飞书群组机器人 Webhook 秘钥。
不能单独配置,需要与飞书群组机器人的 Webhook 地址搭配使用。

DingTalkBotWebhook

参数名称类型是否必选示例值描述
AddressStringhttps://oapi.dingtalk.com/robot/send?access_token=xxx钉钉群组机器人 Webhook 地址,请参见 官方文档

SecretKey

String

SECxxx

钉钉群组机器人 Webhook 秘钥。
不能单独配置,需要与钉钉群组机器人的 Webhook 地址搭配使用。

AtMobilesArray of String["133********"]被@人的手机号,该用户需要在群组里。
AtUserIdsArray of String["********"]被@人的用户 ID,该用户需要在群组里。

请求示例

POST /?Action=UpdateContact&Version=2021-03-03
Content-Type:application/json
{
    "Id": "4a337d5b-0959-4cc7-a3ea-2f71332d4ff3",
    "Name": "test",
    "Email": "test@123.com",
    "Webhook": {
        "Address": "https://www.bytedance.com/",
        "Token": "xxxxxxxx"
    },
    "ContactGroupIds":  ["f9626b5a-0c9e-420e-b6e5-4c66b84f080d"],
    "LarkBotWebhook": {
        "Address": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx",
        "SecretKey": "xxxxxxxx"
    },
    "DingTalkBotWebhook": {
        "Address": "https://oapi.dingtalk.com/robot/send?access_token=xxx",
        "SecretKey": "xxxxxxxx",
        "AtMobiles": ["133********"],
        "AtUserIds": ["********"]
    }
}

返回参数

参数名称类型示例值描述
IdString4a337d5b-0959-4cc7-a3ea-2f71332d4ff3联系人 ID。

SendStatus

String

MessageSucceed.Email

发送邮箱认证信息状态码:

  • AlreadyActive.Email:邮箱已激活
  • MessageFailed.Email:发送验证邮件失败
  • LimitExceeded.Email:发送验证邮件过于频繁
  • MessageSucceed.Email:发送验证邮件成功

Message

String

-

发送邮箱认证信息错误原因。
SendStatus不等于MessageSucceed.Email时,该参数有值。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "UpdateContact",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": "4a337d5b-0959-4cc7-a3ea-2f71332d4ff3",
        "SendStatus": " MessageSucceed.Email"
    }
}

错误码

本接口错误码如下表所示,公共错误码请参见 公共错误码

HTTP 状态码错误码错误信息描述
400InvalidParameter.{{parameter}}The specified {{parameter}} is invalid.参数不合法,请检查参数正确性后重试。
400MissingParameter.{{parameter}}The required parameter {{parameter}} is missing.缺少必要的参数。
403ProductUnsubscribedYou are not subscribed to the Volcengine Managed Service for Prometheus (VMP). Please go to the VMP console web page to subscribe to the service当前账号未订阅 VMP 服务。
404NotFound.IdThe specified Contact {{Id}} is not found.未找到指定联系人。
409Conflict.NameThe specified name conflicts with existing Contact.在同一账户下不能有相同名称的联系人。