删除代码库下的Webhook。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
DELETE /repository/{repositoryId}/hooks/{hookId} HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| repositoryId |
integer |
是 |
代码库 ID |
2369234 |
| hookId |
integer |
是 |
Webhook 的 ID |
524836 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
60de7a6852743a5162b5f957 |
| accessToken |
string |
否 |
个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 |
f0b1e61db5961df5975a93f9129d2513 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| requestId |
string |
请求 ID |
F7B85D1B-D1C2-140F-A039-341859F130B9 |
| errorMessage |
string |
错误信息 |
"" |
| errorCode |
string |
错误码 |
SYSTEM_UNKNOWN_ERROR |
| success |
boolean |
调用是否成功 |
true |
| result |
object |
返回结果 |
|
| id |
integer |
webhook 唯一标识 |
524836 |
| url |
string |
webhook 链接 URL |
https://xxxxx |
| createdAt |
string |
创建时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| projectId |
integer |
代码库 ID |
2369234 |
| pushEvents |
boolean |
是否订阅分支推送事件 可选值:true / false |
true |
| issuesEvents |
boolean |
是否订阅 Issues 事件 可选值:true / false |
false |
| mergeRequestsEvents |
boolean |
是否订阅合并请求事件 可选值:true / false |
true |
| tagPushEvents |
boolean |
是否订阅标签推送事件 可选值:true / false |
true |
| buildEvents |
boolean |
是否订阅 build 事件 可选值:true / false |
false |
| noteEvents |
boolean |
是否订阅评论事件 可选值:true / false |
true |
| enableSslVerification |
boolean |
是否使用 SSL 认证 可选值:true / false |
false |
| lastTestResult |
string |
最后执行结果,可选值:ok / error / ""(空字符串) |
"" |
| description |
string |
Webhook 描述信息 |
Webhook描述内容 |
| secretToken |
string |
用于验证身份的 token,用户自定义 |
xxxx |
| type |
string |
Webhook 类型 可选值: ProjectHook(代码库 webhook); OrganizationHook(企业 webhook) |
ProjectHook |
示例
正常返回示例
JSON格式
{
"requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
"errorMessage": "\"\"",
"errorCode": "SYSTEM_UNKNOWN_ERROR",
"success": true,
"result": {
"id": 524836,
"url": "https://xxxxx",
"createdAt": "2022-03-18 14:24:54",
"projectId": 2369234,
"pushEvents": true,
"issuesEvents": false,
"mergeRequestsEvents": true,
"tagPushEvents": true,
"buildEvents": false,
"noteEvents": true,
"enableSslVerification": false,
"lastTestResult": "\"\"",
"description": "Webhook描述内容",
"secretToken": "xxxx",
"type": "ProjectHook"
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 403 | Forbidden.AccessDenied | The user is not authorized to perform the operation. | 用户无权限执行相关操作 |
| 403 | Forbidden.UserNotInCurrentOrganization | The user is not in the organization and is not authorized to perform the operation. | 当前用户不在该企业中,无权进行操作。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。