Hang on micro-channel platform for third-party network-wide release

No micro-channel public platform for third-party lines, the point of the whole network release, actually send a message to return unsuccessful, call the API fails. Later, when the original document looked at the micro letter issued by third-party platform needs to be done to detect with a micro-channel public number of your own, you see the basic functionality is perfect. His back to the calling you send text function information, if you have your own local testing, to determine the public number is issued to your platform, then the detection time'll just get this test masked, because micro-channel own test public number is you automatically grant to the platform

Third-party platform micro-channel made of two parts of the whole network

     a first portion of

     IF ($ receive_msg_arr [ 'Content'] == 'TESTCOMPONENT_MSG_TYPE_TEXT') {
            $ MSG = $ this-> reTextMsg ( 'TESTCOMPONENT_MSG_TYPE_TEXT_callback');

      }

      direct call interface to the micro-channel Reply Reply TESTCOMPONENT_MSG_TYPE_TEXT_callback this can be a simple comparison of this

      problem was the second part

      of the second portion of the

     extraction query_auth_code. 1

       $ = query_code the explode ( ":", $ receive_msg_arr [ 'Content']);

     2 obtaining third-party platform Ticket

      $ = Weixin_OptweixinModel Ticket: : getTicket ();

    AppID 3 to obtain third-party platforms access_token $ appid third-party platforms, appsecret $ appsecret third-party platforms, $ ticket get the second part of the Ticket

     $ getComAccToken the access_token = ($ AppID, $ appsecret, $ ticket) ;

    4 acquires the public numbers authorized third-party platform AppID $ appid, access_token $ access_token of three acquired, $ query_code [1] The first step in obtaining the

    user authorization code pre

    $ cc = getAuthAccToken ($ appid, $ query_code [1] , $ the access_token);

   . 5 calls the customer service interface to send information

$ dd = sendServiceMsg ($ cc [ 'authorization_info' [ 'authorizer_access_token'], array ( 'touser' => $ receive_msg_arr [ 'fromusername'], 'msgtype' => 'text ',' text '=> array (' content '=> $ query_code [1] .'_ from_api')));


above settings finished, the whole network release point on it, when the release is likely to prompt public access_token No. invalid or duplicate, this not control, try more than once will be successful, because it is possible when you call others are calling

Guess you like

Origin www.cnblogs.com/Fooo/p/12033875.html