云客服-发送消息 (send):报文样例

时间:2024-09-24 14:46:20

报文样例

  • 场景描述:连接机器人

    请求参数:

    {
      "content": "",
      "controlType": "CONNECT",
      "from": "session_1619573111751_user_1619573111751",
      "mediaType": "TEXT",
      "senderNickname": "user_1619573111751",
      "sourceType": "CUSTOMER",
      "timestamp": "1619573122352",
      "to": "1011577355744904195",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "connect to robot successfully."
    }
  • 场景描述:与机器人交谈请求

    请求参数:

    {
      "content": "版本",
      "controlType": "CHAT",
      "from": "session_1619573111751_user_1619573111751",
      "mediaType": "TEXT",
      "senderNickname": "user_1619573111751",
      "sourceType": "CUSTOMER",
      "timestamp": "1619573123199",
      "to": "1011577355744904195",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "Send message to robot successfully"
    }
  • 场景描述:机器人转人工请求

    请求参数:

    {
      "content": "",
      "controlType": "TRANS2AGENT",
      "from": "session_1619573111751_user_1619573111751",
      "mediaType": "TEXT",
      "senderNickname": "user_1619573111751",
      "sourceType": "CUSTOMER",
      "timestamp": "1619573129953",
      "to": "1011577355744904195",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "transfer from robot to agent success."
    }
  • 场景:向座席发送文本消息

    请求参数:

    {
      "content": "这是一条文字消息",
      "controlType": "CHAT",
      "from": "1678101150955228003",
      "mediaType": "TEXT",
      "senderNickname": "user_lk",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540344336",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送图片消息

    请求参数:

    {
      "content": "e31d0e44e82f",
      "controlType": "CHAT",
      "from": "lk_line_05",
      "mediaType": "IMAGE",
      "senderNickname": "lk_line_05",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540640554",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "LINE"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送音频消息

    请求参数:

    {
      "content": "157831a24986",
      "controlType": "CHAT",
      "from": "lk_line_05",
      "mediaType": "AUDIO",
      "senderNickname": "lk_line_05",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540640554",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "LINE"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送视频消息

    请求参数:

    {
      "content": "765c360ab724",
      "controlType": "CHAT",
      "from": "lk_line_05",
      "mediaType": "VIDEO",
      "senderNickname": "lk_line_05",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540640554",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "LINE"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送文件消息

    请求参数:

    {
      "content": "test_txt.txt,6,7d9fbcdd-e306-4b84-9831-163fb760cca9,txt",
      "controlType": "CHAT",
      "from": "1678101150955228003",
      "mediaType": "FILE",
      "senderNickname": "user_lk",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540344336",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送文件消息-图片

    请求参数:

    {
      "content": "70d46bb7-2272-43b7-acad-c6f893a79848,png",
      "controlType": "CHAT",
      "from": "1678101150955228003",
      "mediaType": "FILE_IMAGE",
      "senderNickname": "user_lk",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540344336",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景:向座席发送文件消息-视频

    请求参数:

    {
      "content": "0471a58b-0323-4b94-bc90-55ff36344471,mp4",
      "controlType": "CHAT",
      "from": "1678101150955228003",
      "mediaType": "FILE_VIDEO",
      "senderNickname": "user_lk",
      "sourceType": "CUSTOMER",
      "timestamp": "1688038541395",
      "to": "202303061540344336",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
  • 场景描述:向座席发送网页卡片消息

    请求参数:

    {
      "content": "{\"title\":\"测试title 测试title 测试title\",\"description\":\"测试描述 测试描述 测试描述 测试描述\",\"mediaFileId\":\"xxxx-xxxx-xxxx-xxxx-2e171ac78313\",\"mediaFileType\":\"img\",\"redirectUrl\":\"https://www.****.com\"}",
      "controlType": "CHAT",
      "from": "session_1619573111751_user_1619573111751",
      "mediaType": "WEBCARD",
      "senderNickname": "user_1619573111751",
      "sourceType": "CUSTOMER",
      "timestamp": "1619573129953",
      "to": "1011577355744904195",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }
    响应参数:
    {
        "resultCode": "0",
        "resultDesc": "sendUserMessage successfully."
    }
    或
    {
        "resultCode": "3",
        "resultDesc": "The redirection address is not in the trust list, contact operation staff to add it."
    }
  • 场景描述:断连请求

    请求参数:

    {
      "content": "",
      "controlType": "DISCONNECT",
      "from": "session_1619573842490_user_1619573842490",
      "mediaType": "TEXT",
      "senderNickname": "user_1619573842490",
      "sourceType": "CUSTOMER",
      "timestamp": "1619573854156",
      "to": "1011577355744904195",
      "userAgent": null,
      "senderAvatar": null,
      "channel": "WEB"
    }

    响应参数:

    {
        "resultCode": "0",
        "resultDesc": "Disconnect robot successfully"
    }
support.huaweicloud.com/api-ccfs-cec/cec_07_2204.html