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

 明依丞 发布于 2022-11-18 23:35

/**

    • @多客服

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

    • @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;

      }

    撰写答案
    今天,你开发时遇到什么问题呢?
    立即提问
    热门标签
    PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有