# 说明

新建Webhook配置,返回新建Webhook配置的数据

# url

https://apiv2.tapd.tencent.com/webhook_settings

# 支持格式

JSON/XML(默认JSON格式)

# HTTP请求方式

POST

# 请求数限制

一次插入一条数据

# 请求参数

字段名 必选 类型及范围 说明
workspace_id integer 项目ID
url string 接收 Webhook 请求的URL(devcloud地址如使用端口号支持80,443,8080,8081其他需要申请网络策略)
events string 事件。取值见页尾
content_type enum('json','form') 数据格式。取 json 或者 form,默认 json
secret string 验证密码(非必选,给接入方验证请求是否来自 TAPD)
owner string 配置负责人理人
rio_token string 应用网关token

# 调用示例及返回结果

# 创建项目Webhook配置

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' -d 'url=https://www.tapd.cn/&events=bug::create,bug::update,bug::delete&workspace_id=10158231' 'https://apiv2.tapd.tencent.com/webhook_settings'

# curl 使用 OAuth Access Token 鉴权调用示例

curl -H 'Authorization: Bearer ACCESS_TOKEN' -d 'url=https://www.tapd.cn/&events=bug::create,bug::update,bug::delete&workspace_id=10158231' 'https://apiv2.tapd.tencent.com/webhook_settings'

# 返回结果

{
    "status": 1,
    "data": {
        "WebhookSetting": {
            "id": "1010158231000002151",
            "workspace_id": "10158231",
            "url": "https:\/\/www.tapd.cn\/",
            "content_type": "json",
            "secret": "",
            "owner": "",
            "events": "bug::create,bug::update,bug::delete",
            "status": "normal",
            "creator": "api_doc_oauth",
            "created": "2020-03-10 14:48:19",
            "modifier": "api_doc_oauth",
            "modified": "2020-03-10 14:48:19"
        }
    },
    "info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# Webhook配置字段说明

# Webhook配置重要字段说明

字段 说明
id id
workspace_id 项目ID
url 接收 Webhook 请求的URL
content_type 数据格式。取 json 或者 form,默认 json
secret 验证密码(非必选,给接入方验证请求是否来自 TAPD)
owner 配置负责人理人
events 事件。取值见页尾
status 配置状态
rio_token 应用网关token
creator 配置创建人。取 API 帐号
created 创建时间
modifier 配置最后人。取 API 帐号
modified 最后修改时间

# Webhook配置数据格式(content_type)取值字段说明

取值 字面值
json json 格式,默认格式
form 即 application/x-www-form-urlencoded 形式 ,如 key1=value1&key2=value2

# Webhook配置事件(events)取值字段说明,可写多个,使用 , 分隔

取值 字面值
launchform::create 发布评审创建
launchform::update 发布评审更新
bug::create 缺陷创建
bug::update 缺陷更新
bug::delete 缺陷删除
story::create 需求创建
story::update 需求更新
story::delete 需求删除
story::bug_link 需求关联缺陷
story::bug_unlink 需求解除关联缺陷
task::create 任务创建
task::update 任务更新
task::delete 任务删除
release::create 发布计划创建
release::update 发布计划更新
release::delete 发布计划删除
branch::relate 需求缺陷任务绑定Git分支
branch::unrelate 需求缺陷任务解除绑定Git分支
story_comment::add 需求评论添加
story_comment::update 需求评论更新
story_comment::delete 需求评论删除
bug_comment::add 缺陷评论添加
bug_comment::update 缺陷评论更新
bug_comment::delete 缺陷评论删除
task_comment::add 任务评论添加
task_comment::update 任务评论更新
task_comment::delete 任务评论删除
iteration::create 迭代创建
iteration::update 迭代更新
iteration::delete 迭代删除
workitem_time_relation::bind 前后置对象绑定
workitem_time_relation::unbind 前后置对象解绑
上次更新: 2023-12-19 16:13:22