修改 Webhook
接口概述
- 功能:修改 webhook 数据
- 请求方式: POST
- 请求地址:/api/surveys/{survey_id}/webhooks/{webhook_id}?appid={appid}&access_token={access_token}
请求参数
参数名 | 类型 | 必须 | 参数位置 | 描述 | 示例值 |
---|---|---|---|---|---|
survey_id | integer | 是 | uri | 问卷ID | 292190 |
webhook_id | integer | 是 | uri | webhook ID | 42 |
url | string | 是 | body | 进行数据推送的Url | 43 |
is_active | bool | 是 | body | 是否启用(true:启用 false:关闭) | true |
响应参数
参数名 | 类型 | 描述 |
---|---|---|
id | integer | 自增ID |
url | string | url |
is_active | bool | 是否启用 |
created_at | datetime | 创建时间 |
updated_at | datetime | 修改时间 |
响应示例
- 请求成功
{
"code": "OK",
"error": {
"type": ""
},
"data": {
"id": 42,
"user_id": 1411902221,
"object": "Survey_292190",
"url": "https://wesurvey.com/",
"secret": "open_test",
"is_active": true,
"options": "{\"listenedResources\":[\"answer\"]}",
"created_at": "2021-06-21 16:02:33",
"updated_at": "2021-06-21 16:02:33"
},
"request_id": "e4b27037-d876-427d-95c7-d5a737dd1677"
}
- 请求失败
{
"code": "InvalidArgument",
"error": {
"type": "invalid_argument_url",
},
"data": {},
"request_id": "ddec96d2-165e-4f3e-8a64-2057db116983"
}
错误码
error.type 错误代码 | 错误描述 |
---|---|
permission_denied | 无创建权限 |
invalid_argument_url | url不合法 |
invalid_argument | 参数校验不通过 |
not_found | 找不到数据 |
update_error | 创建webhook失败 |