Ask a question: get an online multi-service list. Returns ERRORCODE:-1, the system is busy. What's going on?

Source: Internet
Author: User
/**

    • @ Multi-Service

    • @ Get online customer Service reception information

    • @return Kf_account Customer Service account @ Alias

    • @return Status 1:pc online, 2: Mobile phone online if PC and mobile phone is 1+2=3

    • @return kf_id Customer Service number

    • Maximum number of automatic access @return auto_accept customer service settings

    • Number of sessions currently being received @return Accepted_case customer service
      */

      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;

        }

    Reply content:

    /**

    • @ Multi-Service

    • @ Get online customer Service reception information

    • @return Kf_account Customer Service account @ Alias

    • @return Status 1:pc online, 2: Mobile phone online if PC and mobile phone is 1+2=3

    • @return kf_id Customer Service number

    • Maximum number of automatic access @return auto_accept customer service settings

    • Number of sessions currently being received @return Accepted_case customer service
      */

      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;

        }

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.