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

CreateContact

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

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

创建告警联系人。

请求说明

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

请求参数

参数名称类型是否必选示例值描述
ActionStringCreateContact公共参数,本接口值:CreateContact。
VersionString2021-03-03公共参数,本接口值:2021-03-03。

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

参数名称类型是否必选示例值描述

Address

String

https://open.feishu.cn/open-apis/bot/v2/hook/xxx

飞书群组机器人 Webhook 地址,使用方法请参见 使用说明

SecretKey

String

6KKxxx

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

DingTalkBotWebhook

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

SecretKey

String

SECxxx

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

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

请求示例

POST /?Action=CreateContact&Version=2021-03-03
Content-Type:application/json
{
    "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/xxxxxx",
        "SecretKey": "xxxxxxxx"
    },
    "DingTalkBotWebhook": {
        "Address": "https://oapi.dingtalk.com/robot/send?access_token=xxxxxx",
        "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": "CreateContact",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": "4a337d5b-0959-4cc7-a3ea-2f71332d4ff3",
        "SendStatus": "MessageSucceed.Email"
        "Message":
    }
}

错误码

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

HTTP 状态码错误码错误信息描述
409Conflict.NameThe specified name conflicts with existing Contact.在同一账户下不能有相同名称的联系人。