接收私信事件
注意:需要授权的抖音用户是企业号 ,需要用户授权scope: enterprise.im
基于Webhooks事件消息推送机制
消息统一结构
{
"event": "receive_msg",
"from_user_id": "",
"to_user_id": "",
"client_key": "",
"content": {}
}
文本消息&未知消息
{
"event": "receive_msg",
"from_user_id": "",
"to_user_id": "",
"client_key": "",
"content": {
"message_type": "text",
"text": "string",
}
}
| 参数 | 含义 |
|---|---|
| message_type | 消息类型 |
| text | 文本消息内容 |
图片消息
图片消息暂时不对外提供。
表情消息
{
"event": "receive_msg",
"from_user_id": "",
"to_user_id": "",
"client_key": "",
"content": {
"message_type": "emoji",
"resource_type": "gif",
"resource_height": 123,
"resource_width": 123,
"resource_url": "http(s)://sssssss"
}
}
| 参数 | 含义 |
|---|---|
| message_type | 消息类型 |
| resource_type | 资源类型 |
| resource_height | 资源高度 |
| resource_width | 资源宽度 |
| resource_url | 资源链接 |
卡片消息
{
"event": "receive_msg",
"from_user_id": "",
"to_user_id": "",
"client_key": "",
"content": {
"message_type": "h5/poi",
"title": "xxx",
"icon_url": "http(s)://ssss",
"description": "xxxxx",
"link_url": "http(s)://sssssss"
}
}
| 参数 | 含义 |
|---|---|
| message_type | 消息类型 |
| title | 卡片标题 |
| icon_url | 卡片图标 |
| description | 卡片描述 |
| link_url | 跳转链接 |
企业号消息卡片消息
{
"event": "receive_msg",
"from_user_id": "",
"to_user_id": "",
"client_key": "",
"content": {
"message_type": "card",
"title": "hhhhh{{xxx}}",
"actions": {
"xxx": {
"name": "text name",
"value": "link",
"action_type": "send_message/redirect/dial_phone"
}
}
}
}
| 参数 | 含义 |
|---|---|
| message_type | 消息类型 |
| title | 消息内容 |
| action | 内容中附带链接的文本内容信息 |
| action相关参数 | 含义 |
|---|---|
| name | 文本信息 |
| value | 文本链接 |
| action_type | 文本点击后的事件类型 |
诚邀您对本文档易读易用性进行评价
好用
不好用