首页 > 请教个问题:获取在线多客服列表。返回errorcode:-1,系统繁忙。是怎么回事?

请教个问题:获取在线多客服列表。返回errorcode:-1,系统繁忙。是怎么回事?

/**

    • @多客服

    • @获取在线客服接待信息

    • @return kf_account 客服账号@微信别名

    • @return status 客服在线状态 1:pc在线,2:手机在线 若pc和手机同时在线则为 1+2=3

    • @return kf_id 客服工号

    • @return auto_accept 客服设置的最大自动接入数

    • @return accepted_case 客服当前正在接待的会话数
      */

    1. function get_online_kf_list($i=0){

         $url = "https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=". $this->access_token;
         $res = $this->https_request($url);
         $data = json_decode($res, true);
         //返回{ "errcode": -1, "errmsg": "system error" } 系统繁忙,求指点。
         log_message('error', var_export($data, true), 'weixin-duokefu');
         if(isset($data['errcode'])&&$data['errcode']=='40001'){
             $i++;
             $this->getAccessToken();
             return $i<3?$this->get_online_kf_list($i):$data;
         }
         return $data;

      }

    【热门文章】
    【热门文章】