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

ListContacts

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

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

获取告警联系人列表。

请求说明

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

请求参数

参数名称类型是否必选示例值描述
ActionStringListContacts公共参数,本接口值:ListContacts。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
PageNumberInteger1当前页数,最小值或默认值均为 1。

PageSize

Integer

10

单页数量:

  • 取值范围为 0~100。
  • 默认值为 10。
FilterObject ContactFilter-联系人过滤条件。

ContactFilter

参数名称类型是否必选示例值描述
IdsArray of String["4a337d5b-0959-4cc7-a3ea-2f71332d4ff3"]按联系人 ID 过滤,精确查询。
NameStringtest按联系人名称过滤,模糊查询。
EmailStringtest@123.com按联系人邮箱过滤,模糊查询。

请求示例

POST /?Action=ListContacts&Version=2021-03-03
Content-Type:application/json
{
    "PageNumber": 1,
    "PageSize": 10,
    "Filter": {
        "Ids": ["4a337d5b-0959-4cc7-a3ea-2f71332d4ff3"],
        "Name": "test",
        "Email": "test@123.com"
    }
}

返回参数

参数名称类型示例值描述
TotalInteger100联系人总数。
ItemsArray of Contact-联系人列表。

Contact

参数名称类型示例值描述
IdString4a337d5b-0959-4cc7-a3ea-2f71332d4ff3联系人 ID。
NameStringtest联系人名称。
EmailStringtest@123.com联系人邮箱。
WebhookObject Webhook联系人通用 Webhook。
ContactGroupIdsArray of String["f9626b5a-0c9e-420e-b6e5-4c66b84f080d"]联系人所属联系人组 ID。
LarkBotWebhookObject LarkBotWebhook-联系人飞书群组机器人 Webhook。
DingTalkBotWebhookObject DingTalkBotWebhook-联系人钉钉群组机器人 Webhook。

EmailActive

Boolean

true

联系人邮箱是否被激活,取值:

  • true:邮箱已被激活。
  • fales:邮箱未被激活。
CreateTimeString2020-01-01T00:00:00Z联系人创建时间,RFC3339 格式。

Webhook

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

LarkBotWebhook

参数名称类型示例值描述
AddressStringhttps://open.feishu.cn/open-apis/bot/v2/hook/xxx飞书群组机器人 Webhook 地址。
SecretKeyString6KKxxx飞书群组机器人 Webhook 秘钥。

DingTalkBotWebhook

参数名称类型示例值描述
AddressStringhttps://oapi.dingtalk.com/robot/send?access_token=xxx钉钉群组机器人 Webhook 地址。
SecretKeyStringSECxxx钉钉群组机器人 Webhook 秘钥。
AtMobilesArray of String["133********"]被@人的手机号。
AtUserIdsArray of String["********"]被@人的用户 ID。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "ListContacts",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Total": 100,
        "Items": [
            {
                "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": "6KKxxx"
                },
                "DingTalkBotWebhook": {
                    "Address": "https://oapi.dingtalk.com/robot/send?access_token=xxx",
                    "SecretKey": "SECxxx",
                    "AtMobiles": ["133********"],
                    "AtUserIds": ["********"]
                },
                "EmailActive": true,
                "CreateTime": "2020-01-01T00:00:00Z"
            }
        ]
    }
}

错误码

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

HTTP 状态码错误码错误信息描述
400InvalidParameter.{{parameter}}The specified {{parameter}} is invalid.参数不合法,请检查参数正确性后重试。
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 服务。