Skip to main content

发送 RCS 消息

域名

  • https://chat-api.incsapp.com

请求路由

  • /external/messages/rcs

请求方式

  • POST

请求头

  • Content-Type: application/json
  • certification-code: af92196e-0d07-3c1d-a631-a71c...

请求参数

请求参数列表

参数名 类型 必填 描述
to string 收信人手机号,必须是国家码+手机号的纯数字格式,如 "8526841511234"
type string 消息类型,支持模板消息:template,和普通消息(需要用户回复的24小时内可以发送):text, image, video, document
  • 每种消息需要的参数见请求示例

请求示例

不包含参数的模板消息请求示例
{
    "to": "85268411234",
    "type": "template",
    "template": {
        "name": "test_button_reply_1"
    }
}
包含参数的模板消息请求示例
  • 填写所有模板部位的参数名和参数值
{
    "to": "85268411234",
    "type": "template",
    "template": {
        "name": "test_button_reply_1",
        "parameters": {
            "username": "jack",
            "service_name": "promotion"
        }
    }
}
text 消息示例
{
    "to": "85268411234",
    "type": "text",
    "text": "Hello"
}
image 消息示例
{
    "to": "85268411234",
    "type": "image",
    "image": {
        "link": "https://static.incsapp.com/chat/images/header-98403274893.png"
    }
}
video 消息示例
{
    "to": "85268411234",
    "type": "video",
    "video": {
        "link": "https://static.incsapp.com/chat/videos/abc.mp4"
    }
}
document 消息示例
  • 支持类型:.pdf
{
    "to": "85268411234",
    "type": "document",
    "document": {
        "link": "https://static.incsapp.com/chat/files/template.pdf"
    }
}

响应

成功响应示例

{
    "status": "success",
    "code": 200,
    "message": "",
    "data": {
        "msg_id": "019b8d8e-c4e7-73fe-b333-470c51e61f9f" // Msg ID
    },
    "error": {}
}

失败响应示例

{
    "status": "error",
    "code": 10004,
    "message": "Template with the code [api_4_standalone_image] and bot [Wk3rZWBx435KKATY] received with insufficient custom params",
    "data": {},
    "error": {}
}