npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cs-sock

v0.3.42

Published

A lib of sockjs to be used in Intelligent-CS

Downloads

129

Readme

智能客服-访客端接口(cs-sock)文档

该文档为智能客服访客端中使用的cs-sock包的api文档,封装了访客端中的http和websocket请求。

其中,使用Axios来处理http请求,并通过传入的配置进行初始化。

初始化配置信息如下:

对于websocket长链接,我们引入了sockjs来支持兼容性问题(如:部分浏览器不支持websocket)。并通过引入stompjs包装sockjs对象,处理心跳,ack消息确认等情况。

cs-sock已发布到npm,可直接intsall使用。

下面简单介绍介个步骤:

  • 安装

    npm install cs-sock
  • 引入

    import {ReqOnline} from 'cs-sock';
  • 使用

    // 首先设置默认请求配置
    // 此处传入的配置对象参照AxiosConfig类型定义
    ReqOnline({baseUrl: 'v1/tanentId/_df2nba'});
    
    // http请求
    ReqOnline.fetchQuestionnaire();
    // 特殊配置
    ReqOnline.create({baseUrl: 'v3/tanentId/_nd9swl'}).sendVisitorMessage(...);
      
    //websocket
    ReqOnline.createSocketStomp(url,{groupsessionId,uid}, callBack);

http请求

绝大部分接口在成功时(即response.data.code === ok)都将直接返回请求对象的data属性值response.data

并且在异常时返回抛出一个包含error及错误消息的对象,{error, msg: 'XXXXXXXX失败'}

  1. 获取询前表单内容

    • 说明

      该请求应首先调用,可获取客服端系统设置内容中统一设置(后期将添加权限控制)的询前表单内容。

      fetchQuestionnaire(): promise
    • 请求参数

    • 返回数据

      返回promise对象,请求成功后将返回data数据

      {
        "baseSuccess": true,
          "globalConfigEntity": [
            {
              "configCode": "FORM_INQUIRY",
              "configDescription": "",
              "configName": "formInquiry",
              "configState": true,
              "configType": 5,
              "configValue": "{\"reminder\":true,\"words\":\"欢迎咨询\",\"check\":false,\"validateStatus\":\"success\",\"help\":\"\"}",
              "tenantId": "_1LWHJ9M"
            }
          ],
            "globalConfigFormEntity": [
              {
                "configType": 5,
                "formDescribe": "这里填写姓名",
                "formId": "f_2304ae79-7a00-43d5-af55-665d361665aa",
                "formTitle": "姓名",
                "gmtCreate": 1563178620000,
                "gmtModified": 1563178620000,
                "id": 12,
                "isEnable": true,
                "staffId": "s_59a6b74881b743688cd4316e08a11dd7",
                "tenantId": "_1LWHJ9M"
              },
              {
                "configType": 5,
                "formDescribe": "这里填写咨询问题",
                "formId": "f_6cf403bb-eb6c-40a1-b768-24ebac0d0731",
                "formTitle": "咨询问题",
                "gmtCreate": 1563178639000,
                "gmtModified": 1563178639000,
                "id": 13,
                "isEnable": true,
                "staffId": "s_59a6b74881b743688cd4316e08a11dd7",
                "tenantId": "_1LWHJ9M"
              }
            ],
         "httpStatusCode": 0
      }
    • 例子

      ReqOnline.fetchQuestionnaire();
  2. 创建会话

    • 说明

      该接口用于初始化聊天窗口,需传入带有windowId的对象,其他各参数暂不做处理。

      createConversation(param: object): promise
    • 请求参数

      {
        windowId: 'WIN00000008',
        os: null,
        device: null,
        channel: "pc"
      }
    • 返回参数

      返回promise对象,请求成功后可获取groupsessionId和uid,大多数http请求及在长链接里用stomp中起订阅时都需要这两参数

      {
        "baseSuccess": true,
        "groupSessionId": "68d2dd58d9814041abfe8207f119fb16",
        "httpStatusCode": 0,
        "isNewSession": false,
        "uid": "v_a_6151fe3009f14b678b57acda75a28041"
      }
    • 例子

      ReqOnline.createConversation(param);
  3. 获取访客信息

    • 说明

      该接口需在创建会话后,成功返回uid参数才可调用。通过uid唯一标识拿到访客信息。

      visitorInfo(uid: string): promise
    • 请求参数

      createConversation返回的uid

    • 返回参数

      返回promise对象,成功后可获取访客参数

      {
        "avatar": "http://47.98.182.201:7008/line_icon_photo04.svg", //头像
        "baseSuccess": true,
        "chats": [],
        "httpStatusCode": 0,
        "openId": "v_a_63a80abaf0c14e4fac833f52e6a256d9",//游客ID
        "personasLabel": "",
        "userName": "anonymous" //名称
      }
    • 例子

      ReqOnline.visitorInfo('sf21349723947982374');
  4. 获取聊天窗配置

    • 说明

      该接口只需通过windowId即可调用,返回聊天窗具体的配置。

      configOfWindow(windowId: string): promise
    • 请求参数

      windowId,该参数为初始化设置内容,无需请求后台获取。

    • 返回参数

      {
        "baseSuccess": true,
        "globalConfigList": [
          {
            "configCode": "MAX_HISTORY_MESSAGE_NUMBER",
            "configDescription": "",
            "configName": "maxHistoryMessageNumber",
            "configState": false,
            "configType": 0,
            "configValue": "30",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "CRM_URL",
            "configDescription": "",
            "configName": "crmUrl",
            "configState": false,
            "configType": 0,
            "configValue": "2",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "REPORT_URL",
            "configDescription": "",
            "configName": "ReportUrl",
            "configState": false,
            "configType": 0,
            "configValue": "114",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "MQ_URL",
            "configDescription": "",
            "configName": "maxHistoryMessageNumber",
            "configState": false,
            "configType": 0,
            "configValue": "30",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "TRANSFER_CONFIRMATION",
            "configDescription": "",
            "configName": "transferConfirmation",
            "configState": false,
            "configType": 0,
            "configValue": "true",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "INPUT_INSTRUCTIONS",
            "configDescription": "",
            "configName": "inputInstructions",
            "configState": false,
            "configType": 0,
            "configValue": "false",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "REPEATED_CONSULTATION",
            "configDescription": "",
            "configName": "repeatedConsultation",
            "configState": false,
            "configType": 0,
            "configValue": "false",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "DISPLAY_AVATAR",
            "configDescription": "",
            "configName": "displayAvatar",
            "configState": false,
            "configType": 1,
            "configValue": "staff",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "CORPORATION_LOGO",
            "configDescription": "",
            "configName": "corporationLogo",
            "configState": false,
            "configType": 1,
            "configValue": "",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "UNFINISHED_SERVICE_CLASS_REMINDER",
            "configDescription": "",
            "configName": "unfinishedServiceClassReminder",
            "configState": false,
            "configType": 1,
            "configValue": "true",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "STAFF_TIMEOUT_REMINDER",
            "configDescription": "",
            "configName": "staffTimeoutReminder",
            "configState": false,
            "configType": 1,
            "configValue": {
              "reminder": false,
              "words": "客服人员正在努力查询中,请稍候",
              "time": 1
            },
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "VISITOR_TIMEOUT_REMINDER",
            "configDescription": "",
            "configName": "visitorTimeoutReminder",
            "configState": false,
            "configType": 1,
            "configValue": {
              "reminder": false,
              "words": "您好,请问还有其他业务咨询吗",
              "time": 1
            },
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "SESSION_TIMEOUT_REMINDER",
            "configDescription": "",
            "configName": "sessionTimeoutReminder",
            "configState": false,
            "configType": 1,
            "configValue": {
              "reminder": true,
              "words": "您好,我们长时间没有收到回复,系统将结束此次会话",
              "time": 240
            },
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "WELCOME_WORDS",
            "configDescription": "",
            "configName": "welcomeWords",
            "configState": false,
            "configType": 1,
            "configValue": "您好,请问有什么可以帮您",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "CONNECTED_SESSION_WORDS",
            "configDescription": "",
            "configName": "connectedSessionWords",
            "configState": false,
            "configType": 1,
            "configValue": "欢迎咨询",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "START_SESSION_WORDS",
            "configDescription": "",
            "configName": "startSessionWords",
            "configState": false,
            "configType": 1,
            "configValue": "正在为您转接人工服务,请稍候",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "CLOSE_SESSION_WORDS",
            "configDescription": "",
            "configName": "closeSessionWords",
            "configState": false,
            "configType": 1,
            "configValue": "当前对话已结束,如需服务请重新打开聊天窗口",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "EVALUATION_WORDS",
            "configDescription": "",
            "configName": "evaluationWords",
            "configState": false,
            "configType": 1,
            "configValue": "感谢您的咨询,请对我们的服务做出评价,谢谢",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "WAITING_QUEUE_WORDS",
            "configDescription": "",
            "configName": "waitingQueueWords",
            "configState": false,
            "configType": 1,
            "configValue": "您在排队中,请稍后",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "ROBOT_ICON",
            "configDescription": "",
            "configName": "robotIcon",
            "configState": false,
            "configType": 1,
            "configValue": "https://img.alicdn.com/tfs/TB1mvwxjvDH8KJjy1XcXXcpdXXa-160-160.png",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "WAITING_CLOSE_WORDS",
            "configDescription": "",
            "configName": "waitingCloseWords",
            "configState": false,
            "configType": 1,
            "configValue": "结束排队",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "MESSAGE_TO_CUSTOMER",
            "configDescription": "",
            "configName": "messageToCustomer",
            "configState": false,
            "configType": 1,
            "configValue": {
              "words": "你的留言已接受!",
              "tocustomer": true
            },
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "EVALUATION_CONTEXT",
            "configDescription": "",
            "configName": "evaluationContext",
            "configState": false,
            "configType": 1,
            "configValue": [
              {
                "guidanceDocument": "请填写满意度信息",
                "declare": "非常满意,五星好评",
                "selectedLabel": [
                  "没解决问题"
                ],
                "rate": 5,
                "labelRequired": 1,
                "guideLanguage": "欢迎给我们服务提建议〜",
                "guideLanguageRequired": 1,
                "label": [
                  "没解决问题",
                  "不礼貌",
                  "服务态度差",
                  "回答不及时"
                ],
                "switch": 1
              },
              {
                "guidanceDocument": "非常满意,完美",
                "declare": "非常满意,四星好评",
                "selectedLabel": [
                  "没解决问题"
                ],
                "rate": 4,
                "labelRequired": 1,
                "guideLanguage": "欢迎给我们服务提建议〜",
                "guideLanguageRequired": 1,
                "label": [
                  "没解决问题",
                  "不礼貌",
                  "服务态度差",
                  "回答不及时"
                ],
                "switch": 1
              },
              {
                "guidanceDocument": "非常满意,完美",
                "declare": "满意,三星好评",
                "selectedLabel": [
                  "没解决问题"
                ],
                "rate": 3,
                "labelRequired": 1,
                "guideLanguage": "欢迎给我们服务提建议",
                "guideLanguageRequired": 1,
                "label": [
                  "没解决问题",
                  "不礼貌",
                  "服务态度差",
                  "回答不及时"
                ],
                "switch": 1
              },
              {
                "guidanceDocument": "非常满意,完美",
                "declare": "不满意,二星评价",
                "selectedLabel": [
                  "没解决问题"
                ],
                "rate": 2,
                "labelRequired": 1,
                "guideLanguage": "欢迎给我们服务提建议",
                "guideLanguageRequired": 1,
                "label": [
                  "没解决问题",
                  "不礼貌",
                  "服务态度差",
                  "回答不及时"
                ],
                "switch": 1
              },
              {
                "guidanceDocument": "非常满意,完美",
                "declare": "不满意,一星评价",
                "selectedLabel": [
                  "没解决问题"
                ],
                "rate": 1,
                "labelRequired": 1,
                "guideLanguage": "欢迎给我们服务提建议",
                "guideLanguageRequired": 1,
                "label": [
                  "没解决问题",
                  "不礼貌",
                  "服务态度差",
                  "回答不及时"
                ],
                "switch": 1
              }
            ],
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "CUSTOMER_SESSION_TIPS",
            "configDescription": "",
            "configName": "customerSessionTips",
            "configState": false,
            "configType": 1,
            "configValue": "false",
            "tenantId": "_1LbQBhY"
          },
          {
            "configCode": "DISABLE_TIMEOUT_SET",
            "configDescription": "",
            "configName": "disableTimeoutSet",
            "configState": false,
            "configType": 1,
            "configValue": {
              "reminder": true,
              "time": 5
            },
            "tenantId": "_1LbQBhY"
          }
        ],
        "httpStatusCode": 0,
        "noticeList": [],
        "skillGroupList": [
          {
            "description": "777777",
            "disableEnable": true,
            "gmtCreate": 1560241906000,
            "gmtModified": 1560241906000,
            "id": 34,
            "name": "7777777",
            "skillGroupId": "e3516bda-7742-49d8-be29-5155b7a9b65a",
            "tenantId": "_1LbQBhY",
            "type": 1
          }
        ],
        "windowConfig": {
          "artificialEntryCount": 1,
          "artificialKeywords": "",
          "createDate": 1560242004000,
          "gmtCreate": 1560242004000,
          "gmtModified": 1560242069000,
          "inputDefault": "",
          "robotCode": "",
          "robotFlag": 0,
          "skillGroupFlag": 1,
          "sorryText": "",
          "tenantId": "_1LbQBhY",
          "title": "7777777",
          "updateDate": 1560242069000,
          "voiceFlag": 0,
          "windowId": "WIN00000002"
        }
      }
    • 例子

      ReqOnline.configOfWindow('win0000008');
  5. 获取访客的历史消息

    • 说明

      该接口通过uid指定访客,返回该访客的历史消息。

      historyMessage(uid: string): promise
    • 请求参数

      uid,该参数由createConversation返回。

    • 返回参数

      [

    { "from": "SYSTEM", "groupSessionId": "9d6e7f07eb924523a9cde06ec3000482", "messageBody": { "userId": "v_a_8313d098530040f199ef75bd374c04f4" }, "messageId": "6562242514055593987", "messageType": "event/visitorDropped", "sentTime": 1564560535052, "sessionId": "8ca6538c8be64df7aaee45788b46ac29", "tenantId": "_1LbQBhY", "to": "SYSTEM" }, { "from": "SYSTEM", "groupSessionId": "9d6e7f07eb924523a9cde06ec3000482", "messageId": "6562234966804004867", "messageType": "event/sessionCreated", "sentTime": 1564558735637, "sessionId": "8ca6538c8be64df7aaee45788b46ac29", "tenantId": "_1LbQBhY", "to": "SYSTEM" } ]

    
    - 例子
    
    ```js
    ReqOnline.historyMessage('fa1238102934123')
  6. 获取技能组

    • 说明

      该接口返回一个随机的技能组(在线,即可沟通状态的),通过返回的skillgroupId触发转人工。

      fetchSkillGroup(): promise
    • 请求参数

    • 返回参数

      //技能组id,0表示无可用技能组,即无客服在线 
      {
        "skillGroupId":"9c4ce272-b20e-4f55-aa92-5f8f6b6dd7da" 
      }
    • 例子

      ReqOnline.fetchSkillGroup();
  7. 获取客服信息

    • 说明

      fetchCSInfo(staffId: string): promise
    • 请求参数

      staffId,通过发送转人工消息后可获取。

    • 返回参数

      返回promise对象,成功后可获取头像、姓名等信息。

      {
        "baseSuccess": true,
        "httpStatusCode": 0,
        "staffInfo": {
          "avatar": "",
          "displayName": "熊欢",
          "id": 2,
          "isDeleted": 0,
          "staffId": "s_ee01c17bc5124b67998a2578ecf14ed6",
          "tenantId": "_1IzFhyC",
          "username": "admin001"
        }
      }
    • 例子

      ReqOnline.fetchCSInfo('fa08971982739129713')
  8. 获取满意度配置

    • 说明

      该接口返回满意度配置信息,通过该配置动态渲染弹窗中的填入项。

      visitorShowEvaluate(): promise
    • 请求参数

    • 返回参数

      返回promise对象,成功后将返回统一的满意度配置信息,根据配置动态渲染页面弹窗的form表单选项

      {
          "baseSuccess": true,
          "globalConfig": {
            "configCode": "EVALUATION_CONTEXT",
            "configDescription": "",
            "configName": "evaluationContext",
            "configState": true,
            "configType": 1,
            "configValue": "[{\"guidanceDocument\":\"请填写满意度信息\",\"declare\":\"非常满意,五星好评231\",\"selectedLabel\":[\"没解决问题\"],\"rate\":5,\"labelRequired\":1,\"guideLanguage\":\"欢迎给我们服务提建议〜\",\"guideLanguageRequired\":1,\"label\":[\"没解决问题\",\"不礼貌\",\"服务态度差\",\"回答不及时\"],\"switch\":1},{\"guidanceDocument\":\"非常满意,完美\",\"declare\":\"32非常满意,四星好评23\",\"selectedLabel\":[\"没解决问题\",\"回答及时\"],\"rate\":4,\"labelRequired\":1,\"guideLanguage\":\"欢迎给我们服务提建议〜\",\"guideLanguageRequired\":1,\"label\":[\"没解决问题\",\"回答及时\"],\"switch\":1},{\"guidanceDocument\":\"非常满意,完美\",\"declare\":\"满意,三星好评\",\"selectedLabel\":[\"没解决问题\"],\"rate\":3,\"labelRequired\":1,\"guideLanguage\":\"欢迎给我们服务提建议\",\"guideLanguageRequired\":1,\"label\":[\"没解决问题\",\"不礼貌\",\"服务态度差\",\"不礼貌\",\"不礼貌\"],\"switch\":1},{\"guidanceDocument\":\"非常满意,完美\",\"declare\":\"不满意,二星评价\",\"selectedLabel\":[\"没解决问题\",\"不礼貌\",\"服务态度差\"],\"rate\":2,\"labelRequired\":1,\"guideLanguage\":\"欢迎给我们服务提建议\",\"guideLanguageRequired\":1,\"label\":[\"没解决问题\",\"不礼貌\",\"服务态度差\",\"回答不及时\"],\"switch\":1},{\"guidanceDocument\":\"非常满意,完美\",\"declare\":\"不满意,一星评价\",\"selectedLabel\":[\"没解决问题\",\"不礼貌\"],\"rate\":1,\"labelRequired\":0,\"guideLanguage\":\"欢迎给我们服务提建议\",\"guideLanguageRequired\":1,\"label\":[\"没解决问题\",\"不礼貌\",\"服务态度差\",\"回答不及时\"],\"switch\":1}]",
            "tenantId": "_1LWHJ9M"
          },
          "httpStatusCode": 0
        }
    • 例子

      ReqOnline.visitorShowEvaluate();
  9. 提交满意度表单

    • 说明

      在获取满意度配置之后动态渲染form表单填入项,于提交时触发该接口。

      sendEvaluate(param: object): proimse
    • 请求参数

      {
        "context": "qweqweqe",
        "from": "v_a_63a80abaf0c14e4fac833f52e6a256d9",
        "groupSessionId": "30b49dc12fe24f05bef902ecd66df965",
        "sendTime": 1564464949613,
        "reason": "非常满意,五星好评231",
        "score": 5,
        "selectedLabel": "没解决问题",
        "sessionId": "714ad2694a9b46d4a5e2fcd9803c5ef0"
      }

      其中,groupSessionId需必填

    • 返回参数

      {
        "baseSuccess": true,
        "httpStatusCode": 0,
        "isClosed": false,
        "score": 2
      }
    • 例子

      var param ={
        "context": "qweqweqe",
        "from": "v_a_63a80abaf0c14e4fac833f52e6a256d9",
        "groupSessionId": "30b49dc12fe24f05bef902ecd66df965",
        "sendTime": 1564464949613,
        "reason": "非常满意,五星好评231",
        "score": 5,
        "selectedLabel": "没解决问题",
        "sessionId": "714ad2694a9b46d4a5e2fcd9803c5ef0"
      }
      ReqOnline.sendEvaluate(param)
  10. 访客发送消息

  • 说明

    该接口是通用发消息接口,需提供groupSessionId作为路径参数,param对象根据不同消息类型,自行定义。

    sendVisitorMessage(groupSessionId: string, param: object): promise
  • 请求参数

    groupSessionId,创建会话后可获得。 param,根据不同的消息类型会有不同情况

  • 返回参数

  • 例子

    var param = {
      "from": "s_2de3264254f44d4b97952eefd5b5497d",
      "messageBody": {
        "message": "xsaxsa"
      },
      "message": "xsaxsa",
      "messageType": "text/plain"
    }
    ReqOnline.sendVisistorMessage('fas1237192379', param)
  1. 客户上传图片
  • 说明

    该接口同样需要提供groupsessionId,返回文件地址,前端根据ip加上文件地址可展示该图片

    uploadImage(groupSessionId: string, param: object): promise
  • 请求参数

    groupSessionId,通过创建会话接口可获取。 param,包含图片名fileName和文件uploadFile属性的对象

  • 返回参数

    返回promise对象,成功后可获取文件地址后缀,通过添加后端ip即可成功展示。

    {    					
       "url":"files\\_1LbQBhY\\4dc80fcdd60342cd84e6b35574b67724\\v_a_f3dc972b23a54c9dbcd6427a24ea4a05\\4dc80fcdd60342cd84e6b35574b67724_23672b5f448c4b4bbc0e0ffa2dd558f6.png"  //可访问的图片URL地址
    }
  • 例子

    var param = {
    	fileName: '12312.jpg',
      uploadFile: XXXXXXXXXXXXXXXXXXXXXXX
    }
    ReqOnline.uploadImage('fs1023812412311', param)
  1. 关闭会话

    • 说明

      该接口用于关闭指定会话,通过发送groupSessionIduid

    • 请求参数

      groupSessionIduid由创建会话接口提供。

    • 返回参数

    • 例子

      ReqOnline.closeConversation('qwef1184719837913', 'ufw1939187389139')
  2. 访客发送离线消息(客服不在线时)

    • 说明

      该接口用于客服离线时发送离线消息,需前端根据客服状态判断调用正常发消息还是发送离线消息

sendOfflineMessage(uid: string, param: object): promise ```

- 请求参数

  `uid`,由创建会话接口返回成功可获取。

  `param`访客发送离线消息

  ```json
  {
    messageType: 'text/plain',
    messageBody: '您好'
  }
  ```

- 返回参数

  无

- 例子

  ```js
  var prarm = {
    messageType: 'text/plain',
    messageBody: '您好'
  }
  ReqOnline.sendOfflineMessage('sdfsdfsf', param)
  ```