** 消息定义

文本消息

{
     "type":"TIMTextElem", 
     "content":{
         "Text":"hello!"
     },
     "random":1529874653389
 }

图片消息

 {
     "type":"TIMImageElem", 
     "content":{
         "ImageInfoArray":[ // 使用数组的原因是很多其实一个图片包含大图、中图、小图。如果只有一副,填一个即可
             {
                 "Size":1024,
                 "Width":50,
                 "Hight":60,
                 "URL":""
             }
         ]
     },
     "random":1529874653301000
 }

自定义消息

 {
     "type":"TIMCustomElem", 
     "content":{
       "Desc": "",
       "Data": ""
     },
     "random":1529874653301000
 }

自定义消息定义

1、链接预览

{  
    "Desc": "card1",  
    "Data": toString(
                {
                    "title":"百度一下,你就知道",
                    "sub_title":"二级标题",
                    "image":"http://m.baidu.com/static/index/u.png",
                    "description":"Baidu京ICP证030173号",
                    "url":"http://www.baidu.com"
                }
            )
}

2、语音消息元素

{  
    "Desc": "voice",  
    "Data": "url?text=语音识别结果(没有为空)",  
}

data定义: 文件地址   

3、视频消息元素

{  
    "Desc": "video",  
    "Data": "url",  
}

data定义: 文件地址   

4、通用选项消息元素

{  
    "Desc": "titled_options",  
    "Data": toString(
              {
                "type":"", // option  related_question   recommand
                "title":"这是标题",
                "options":["p1","q2","q3"]
              }
            )  
}

data定义: 常见问题数组  

5、文件消息元素

{  
    "Desc": "file",  
    "Data": toString({"file_name":"file.mp4", "size":92387, "url":"http://cdn.host.com/file.mp4"}),  
}

data定义: 文件属性字段
系统消息
1、会话分配

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "assign",
        "assign_type": "assign_dialog_begin", //分配类型:assign_dialog_begin会话开始  assign_from_robot机器人优先后分配人工  assign_from_queue排队后分配人工
        "b_nick": "nick" // 客服昵称
}

2、会话转接

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "transfer",
        "transfer_type": "transfer_from_robot", //转接类型: transfer_from_robot主动接管   transfer_from_user人与人转接
        "b_nick": "nick",

}

3、会话关闭

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "close",
}

4、进入排队

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "in_queue"
}

5、退出排队

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "quit_queue"
}

6、排队变化

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "waiting_queue_changed",
        "waiting_queue_num": 1
}

7、邀请评价

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "b_invite_scoring"
}

8、C端评价返回

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "c_scoring_ret",
        "score":1,
        "bad_scoring_reason":""
}

9、C端输入提示

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "typing_notify",
        "text":""
}

10、C端设置已读标记

{  
    "Desc": "sys",  
    "Data": toString({
        "customer_id": "customer unique id",
        "type": "c_read"
}

results matching ""

    No results matching ""