接收私信事件

注意:需要授权的抖音用户是企业号 ,需要用户授权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文本点击后的事件类型
诚邀您对本文档易读易用性进行评价
好用
不好用