Skip to main content

INCS 消息回调

回调说明

  • INCS 定义的消息格式
  • 使用INCS工作台接收和回复消息时,可以设置该回调

回调请求方式

  • POST

回调内容

  • 回调分为 消息创建消息状态更新 回调

1. 消息创建(message_created)

参数说明
参数名 类型 必传 描述
event string 此处为 "message_created",发送和接收消息时触发该回调
message object INCS 定义的消息格式
message 结构说明
参数名 类型 必传 描述
id bigint INCS 消息id
auth_id int INCS 消息通道id
conversation_id int INCS 会话id
session_type int INCS 会话类型:1单聊,2群聊
send_id string INCS 发信人id
recv_id string INCS 收信人id
type int INCS 定义的消息类型,见下述
custom_type int INCS 定义的自定义消息类型,type为110时有值
custom_id bigint INCS 定义的自定义消息关联id
channel_msg_id string 消息通道回传的id
channel_status int 发出去的消息状态:0 created, 1 sent, 2 failed, 3 delivered, 4 read
content string 信息体json
error string 错误信息
source int 消息发送方式:0 INCS,1 API
created_at datetime string 消息创建时间,ISO 8601 格式
updated_at datetime string 消息更新时间,ISO 8601 格式
消息类型(type)
枚举值 描述
101 文本消息
101102 文本图片消息
101103音频消息
104视频消息
105 消息
110自定义消息
自定义消息类型(custom_type)
枚举值描述
11002whatsapp 模板消息
11006whatsapp 回复按钮
11008viber otp
11009rcs 模板消息
11010rcs 建议回复
message 内容示例
1. Text101 Message文本消息
{
    "event": "message_created",
    "message": {
        "id": 260400000076,
        "auth_id": 30058,
        "conversation_id": 979,
        "session_type": 1,
        "send_id": "30058_6281519140327",
        "recv_id": "staff_1001",
        "type": 101,
        "custom_type": 0,
        "custom_id": 0,
        "channel_msg_id": "wamid.HBgNNjI4MTUxOTE0MDMyNxUCABIYIEFDQTgwMEZCMUFERjZDQzhDNUVDQzM0Qzg2Qjg0QkI0AA==",
        "channel_status": 0,
        "content": {
            "content": "Hi"
        },
        "error": "",
        "source": 0,
        "created_at": "2026-04-07T12:02:55.000000Z",
        "updated_at": "2026-04-07T12:02:55.000000Z"
    }
}
2. File102 Message
图片消息
{
    "senderPhoneNumber"event": "+628XXXXXXXXX"message_created",
    "messageId": "5312df2b-54e3-457d-8654-49a4f3ba1a19",
    "sendTime": "2024-04-20T10:58:29.951141Z",
    "userFile"message": {
        "thumbnail"id": 260400000079,
        "auth_id": 30058,
        "conversation_id": 979,
        "session_type": 1,
        "send_id": "staff_1001",
        "recv_id": "30058_6281519140327",
        "type": 102,
        "custom_type": 0,
        "custom_id": 0,
        "channel_msg_id": "wamid.HBgNNjI4MTUxOTE0MDMyNxUCABEYEjI2NjgxQjgwMzkyRTQxMzQyMAA=",
        "channel_status": 1,
        "content": {
            "mimeType": "image/jpeg",
            "fileSizeBytes": 8001,
            "fileUri"sourcePath": "https://rcs-user-content-ap.storage.googleapis.incs-test.oss-ap-southeast-1.aliyuncs.com/baf60d40-f197-497f-83f8-5a52fd081262/54b9a1aae33ff62d14ea58db59f43ff04cf62d2329041b110b724b7447a7"
        }chat/images/69d4fca3eede4.png",
            "payload"sourcePicture": {
                "mimeType"uuid": "rc-upload-1775565512163-6",
                "type": "image/jpeg"png",
                "fileSizeBytes"size": 144594,806876,
                "fileName"width": "1000002217.jpg",864,
                "fileUri"height": 864,
                "url": "https://rcs-user-content-ap.storage.googleapis.incs-test.oss-ap-southeast-1.aliyuncs.com/f7cdd990-83ea-4b8d-ba89-73eacf8d7d8a/d63d8f295248fc67cc1716658c169bba70f98b0513798c3c60f56f52734f"chat/images/69d4fca3eede4.png"
            },
            "bigPicture": {
                "uuid": "rc-upload-1775565512163-6",
                "type": "image/png",
                "size": 806876,
                "width": 864,
                "height": 864,
                "url": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/images/69d4fca3eede4.png"
            },
            "snapshotPicture": {
                "uuid": "rc-upload-1775565512163-6",
                "type": "image/png",
                "size": 806876,
                "width": 864,
                "height": 864,
                "url": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/images/69d4fca3eede4.png"
            }
        },
        "agentId"error": "test_vhbgamhn_agent@rbm.goog"
}
3. Response to suggestion – REPLY
{
    "senderPhoneNumber": "+628XXXXXXXXX",
    "messageId": "5312df2b-54e3-457d-8654-49a4f3ba1a19",
    "sendTime": "2024-04-05T13:15:40.152413Z",
    "agentId": "test_vhbgamhn_agent@rbm.goog",
    "suggestionResponse": {
        "postbackData": "user_reply_what_is_rcs",
        "text": "what is RCS?",
        "trackdata": {
            "suggestionType": "reply",
            "msgType": "richcard",
            "cardIndex"source": 0,
        "suggestionIndex": 1,
            "msgId": "019cc232-229a-7353-b860-87709fa4d7d4",
            "msgDate"created_at": "2026-03-06T08:09:51.895Z"04-07T12:46:29.000000Z",
        "template"updated_at": "2217703609111640005"
        },
        "type": "REPLY"2026-04-07T12:46:30.000000Z"
    }
}
4.
3. Response103 to音频消息
suggestion
{
    "event": ACTION"message_created",
    "message": {
        "id": 260400000081,
        "auth_id": 30058,
        "conversation_id": 980,
        "session_type": 1,
        "send_id": "30058_6281519140327",
        "recv_id": "staff_1001",
        "type": 103,
        "custom_type": 0,
        "custom_id": 0,
        "channel_msg_id": "wamid.HBgNNjI4MTUxOTE0MDMyNxUCABIYIEFDMzM1Nzc3RjRDQjkxODc1MzAzMUZFMDlDQTU1QjM4AA==",
        "channel_status": 0,
        "content": {
            "uuid": "2067977394126791",
            "soundPath": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/audios/2067977394126791.ogg",
            "sourceUrl": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/audios/2067977394126791.ogg",
            "dataSize": 3040,
            "duration": 1,
            "soundType": "audio/ogg; codecs=opus"
        },
        "error": "",
        "source": 0,
        "created_at": "2026-04-07T12:54:11.000000Z",
        "updated_at": "2026-04-07T12:54:11.000000Z"
    }
}
5. 104 视频消息
{
    "event": "message_created",
    "message": {
        "id": 260400000082,
        "auth_id": 30058,
        "conversation_id": 980,
        "session_type": 1,
        "send_id": "staff_1001",
        "recv_id": "30058_6281519140327",
        "type": 104,
        "custom_type": 0,
        "custom_id": 0,
        "channel_msg_id": "wamid.HBgNNjI4MTUxOTE0MDMyNxUCABEYEjJDQUE4NjU5RkQyRThEM0ZGRQA=",
        "channel_status": 1,
        "content": {
            "videoUUID": "rc-upload-1775565512163-13",
            "videoUrl": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/videos/69d4fecef09fa.mp4",
            "videoType": "video/mp4",
            "videoSize": 2828720,
            "duration": 39,
            "snapshotPath": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/videos/69d4fecef09fa.mp4?x-oss-process=video/snapshot,t_0,f_jpg,ar_auto",
            "snapshotUUID": "rc-upload-1775565512163-13",
            "snapshotSize": 147949,
            "snapshotUrl": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/videos/69d4fecef09fa.mp4?x-oss-process=video/snapshot,t_0,f_jpg,ar_auto",
            "snapshotWidth": 392,
            "snapshotHeight": 850,
            "snapshotType": "image/png"
        },
        "error": "",
        "source": 0,
        "created_at": "2026-04-07T12:55:46.000000Z",
        "updated_at": "2026-04-07T12:55:47.000000Z"
    }
}
5. 105 文件消息
{
    "event": "message_created",
    "message": {
        "id": 260400000080,
        "auth_id": 30058,
        "conversation_id": 979,
        "session_type": 1,
        "send_id": "staff_1001",
        "recv_id": "30058_6281519140327",
        "type": 105,
        "custom_type": 0,
        "custom_id": 0,
        "channel_msg_id": "",
        "channel_status": 0,
        "content": {
            "filePath": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/files/69d4fdd3bb80e.xlsx",
            "uuid": "rc-upload-1775565512163-8",
            "sourceUrl": "https://incs-test.oss-ap-southeast-1.aliyuncs.com/chat/files/69d4fdd3bb80e.xlsx",
            "fileName": "Rcs-user.xlsx",
            "fileSize": 9095,
            "fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
        },
        "error": "",
        "source": 0,
        "created_at": "2026-04-07T12:51:32.000000Z",
        "updated_at": "2026-04-07T12:51:32.000000Z"
    }
}
6. 110 自定义消息
{
    "senderPhoneNumber": "+628XXXXXXXXX",
    "messageId": "5312df2b-54e3-457d-8654-49a4f3ba1a19",
    "sendTime": "2024-04-05T13:16:42.183829Z",
    "agentId": "test_vhbgamhn_agent@rbm.goog",
    "suggestionResponse": {
        "postbackData": "user_action_open_url",
        "text": "visit our website",
        "trackdata": {
            "suggestionType": "url_action",
            "msgType": "richcard",
            "cardIndex": 0,
            "suggestionIndex": 0,
            "msgId": "019cc232-229a-7353-b860-87709fa4d7d4",
            "msgDate": "2026-03-06T08:09:51.895Z",
            "template": "2217703609111640005"
        },
        "type": "ACTION"
    }
}
5. Location message
{
    "senderPhoneNumber": "+62XXXXXXXXXX",
    "messageId": "b0d0ea18-c809-4206-9ca2-5baf02707fe0",
    "sendTime": "2025-07-29T06:08:36.741050Z",
    "agentId": "test_dev_vhbgamhn_agent@rbm.goog",
    "location": {
        "longitude": 78.3861501,
        "latitude": 17.4370557
    }
}