IM主动授权webhook
收藏我的收藏
概述
- •Webhooks 说明文档可参考:Webhooks 概述
- •申请路径:开发者平台-控制台-小程序-开发-开发配置-webhooks 订阅 im_authorize 事件
- •事件介绍:C 端抖音用户在点击同意 button 组件获取用户私信授权 中拉起的授权弹窗后,收到回调事件。有关小程序主动私信能力,详见 小程序主动私信能力概述
事件名 | 事件介绍 |
im_authorize | IM主动授权 |
事件参数
参数 | 类型 | 含义 | | |
event | string | 事件名,事件唯一标识 | im_authorize | |
from_user_id | string | 授权的C端抖音用户 open_id | | |
to_user_id | string | 被授权的小程序经营者 open_id | | |
client_key | string | 被授权的小程序 app_id | | |
content | string | 具体内容 | | |
create_time | int | 创建时间 | 1670229453 | |
expire_time | int | 过期时间 | 1670229453 | |
update_time | int | 更新时间 | 1670229453 | |
operation_type | int | 操作类型
| 1 | |
auth_status | int | 授权状态
| 1 | |
| source | string | 授权场景,发送私信时,scene字段传该值 | im.direct_message.bind |
| extra | string | 扩展字段 |
|
| log_id | string | 日志ID | 2022120516373301015903714833078B1B |
事件参数示例
{ "event": "im_authorize", //事件名为im_authorize "from_user_id": "", // c 端抖音用户 open_id "to_user_id": "", // 小程序经营者 open_id "client_key": "", //使用应用的client_key "content":"{ \"create_time\":1670229453, //创建时间 \"expire_time\":1672821453, //到期时间 \"update_time\":1670229453, //更新时间 \"operation_type\":1, // 1-新增 2-更新 \"auth_status\":1, //授权状态:1-授权中, 2-未授权 \"source\":\"im.direct_message.bind\", //授权场景,发送私信时,scene字段传该值 \"extra\":\"\", //扩展字段 \"log_id\":\"2022120516373301015903714833078B1B\"//日志ID }" }