Skip to main content

webhook管理

零、注意事项:

0.1 格式说明

所有API,若未特殊注明,Content-Type 全部使用 application/json

0.2 出参约定格式

如无特殊说明,出参固定为以下格式:

参数类型说明
codeint状态码,0 - 成功, 其余为失败
messagestring提示信息
datamixed数据

data 具体格式见每个接口具体说明

0.3 域名

如果无特殊说明,以下 API 中,所有域名均为: https://autocall.icsoc.net

一、webhook列表

1.1 路由

GET /api/v3/webhook/lists

1.2 入参

参数类型说明必填默认值
namestring名称搜索
urlstringurl 搜索
current_pageint当前页1
per_pageint每页数量15

1.3 出参

参数类型说明
current_pageinteger当前页
total_pageinteger总页数
per_pageinteger每页数量
totalinteger总数据量
emptybool数据量是否为空(即 results 是否为空)
resultswebhook[]结果

1.3.1 webhook

参数类型说明
namestringwebhook 名称
urlstringurl
statusbool状态 true->启用 false->禁用
dept_idinteger部门ID
dept_namestring部门名称
event_typeint事件类型 1-挂机话单推送 2-外呼前推送
is_encryptbool推送数据是否加密

1.4 举例

1.4.1 入参

{
"current_page": 1,
"per_page": 20
}

1.4.2 出参

{
"code": 0,
"message": "success",
"request_id": "215fef50ba1a385fb0e00091f45de52d",
"data": {
"current_page": 1,
"total_page": 1,
"per_page": 20,
"total": 3,
"empty": false,
"results": [{
"id": 55,
"vcc_id": 22,
"name": "挂机回调",
"url": "https://www.icsoc.net",
"status": true,
"dept_id": 1,
"event_type": 1,
"is_encrypt": false,
"created_at": "2023-11-07 10:55:47",
"updated_at": "2023-11-07 10:55:47",
"created_user_name": "test",
"created_user_id": 1030785,
"updated_user_name": "test",
"updated_user_id": 1030785,
"dept_name": "中通天鸿"
},
{
"id": 37,
"vcc_id": 22,
"name": "test-测试回调",
"url": "https://www.icsoc.net",
"status": true,
"dept_id": 1,
"event_type": 1,
"is_encrypt": false,
"created_at": "2023-10-27 09:36:46",
"updated_at": "2024-02-22 15:42:07",
"created_user_name": "test",
"created_user_id": 1778,
"updated_user_name": "test",
"updated_user_id": 1778,
"dept_name": "中通天鸿"
},
{
"id": 2,
"vcc_id": 22,
"name": "test-001",
"url": "https://www.icsoc.net",
"status": false,
"dept_id": 114234,
"event_type": 2,
"is_encrypt": false,
"created_at": "2023-08-14 02:18:35",
"updated_at": "2023-10-30 08:21:09",
"created_user_name": "test",
"created_user_id": 1778,
"updated_user_name": "test",
"updated_user_id": 1778,
"dept_name": "中通天鸿"
}
]
}
}

二、webhook新增编辑

2.1 路由

POST /api/v3/webhook/updateOrCreate

2.2 入参

参数类型说明必填默认值
idint主键(编辑必填)
dept_idint部门ID0
namestring名称
urlstring请求地址
statusbool状态 false-关闭 true-启用0
is_encryptbool是否加密 false-否 true-是0
event_typeint事件类型 1-挂机话单 2-呼叫前0

2.3 出参

参数类型说明
namestringwebhook 名称
urlstringurl
statusbool状态 true->启用 false->禁用
dept_idinteger部门ID
dept_namestring部门名称
event_typeint事件类型 1-挂机话单推送 2-外呼前推送
is_encryptbool推送数据是否加密

2.4 举例

2.4.1 入参

{
"name": "url-callback",
"status": true,
"dept_id": 1,
"url": "https://www.icsoc.net",
"is_encrypt": false,
"event_type": 1,
"id": 64
}

2.4.2 出参

{
"code": 0,
"message": "success",
"request_id": "47a52414c5349e5a08e065e24d71705a",
"data": {
"id": 64,
"vcc_id": 22,
"name": "url-callback",
"url": "https://www.icsoc.net",
"status": true,
"dept_id": 1,
"event_type": 1,
"is_encrypt": false,
"created_at": "2024-05-07 10:36:32",
"updated_at": "2024-09-05 11:17:45"
}
}

三、webhook删除

3.1 路由

GET /api/v3/webhook/delete

3.2 入参

参数类型说明必填默认值
idint主键

3.3 出参

无 |

3.4 举例

3.4.1 入参

{
"id": 64
}

3.4.2 出参

{
"code": 0,
"message": "success",
"request_id": "47a52414c5349e5a08e065e24d71705a"
}