概述

    申请路径:开发者平台-控制台-小程序-开发-开发配置-webhooks 订阅 im_authorize 事件
事件名
事件介绍
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-新增
    2-更新
1
auth_status
int
授权状态
    1-授权中
    2-未授权
1
source
string
授权场景,发送私信时,scene字段传该值
im.direct_message.bind
extra
string
扩展字段
主要输出本次授权时的来源,字段含义对齐查询主动私信用户授权状态中相应字段,其结构如下
{ "enter_from": "授权来源", "attribution": { "anchor_id": "主播id", "author_id": "作者id", "conversation_id": "群聊id", "from_att_uid": "消息发送者id", "group_id": "群id", "message_id": "消息id", "room_id": "直播房间id" } "data_im_extra":"micro_app_source",//开发者在主动私信授权组件中的自定义参数 "query":"cptName=button",//用户授权服务账号所在小程序当前页面的query参数 "path":"page/componentTpl/componentTpl" //用户授权服务账号所在小程序当前页面的path参数 }
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 }" }