获取webhook列表

更新时间:2023-04-24 16:38:53

适用产品

CDN Pro

接口描述

获取已创建的webhook接口列表。当你创建部署任务,刷新任务,预取任务,或者配置验证任务时,都可以使用webhook接口来接收任务完成通知。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Params 参数

参数名称描述
offsetInteger
默认值: 0 取值范围: >= 0 查询起始位置。
limitInteger
默认值: 100 取值范围: <= 200 每次查询的最大条数。

返回参数

Body 参数

参数名称描述
countInteger
取值范围: >= 0 webhook接口数量,该数量与查询参数直接相关。
webooksList
idString
webhook接口ID。
nameString
取值范围: <= 250 字符 webhook接口名称。
descriptionString
取值范围: <= 500 字符 webhook接口描述。
creationTimeString
webhook接口创建时间,以RFC 3339日期格式展示。
lastUpdateTimeString
webhook接口最近一次更新时间,以RFC 3339日期格式展示。
lastCallTimeString
webhook接口最近一次调用时间,以RFC 3339日期格式展示。
totalCallsInteger
取值范围: >= 0 webhook接口累计被调用的次数。
hasCredentialsBoolean
是否要求鉴权。

错误码

错误代码(code)描述(message)HTTP状态码语义
InvalidListOffsetThe offset must be a valid non-negative integer.400offset参数取值必须是0或者正整数。
InvalidListLimitThe value of limit should be an integer.400limit参数取值必须是整数。

示例

200
400
200
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/cdn/webhooks" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
返回示例
复制代码 复制成功
{
    "count": 1,
    "webhooks": [
        {
            
            "id": "607ed4b9ae4f763071be9e22",
            "name": "purgeNotification",
            "description": "Tell me when the purge has completed",
            "creationTime": "2021-04-20T13:18:49Z",
            "totalCalls": 0,
            "hasCredentials": true
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!