WeChat Public platform custom menu and Advanced interface php sdk_php tutorials

Source: Internet
Author: User
Tags openid
This article introduces the PHP SDK and how to use the custom menu and advanced interface of the public platform.

Author

Square Double Studio

Correction Record:

2014.05.03 v1.0

< span="">

SDK Source code:

         = ""  = ""    __construct (=,=  ( ->appid =  ( ->appsecret =    ->lasttime = 1395049256 ->access_token = " Nrzvvpdu7lxcsi7gng2lrucmkbaeczrf0nydbwklng4nmpf88d34pkzdncvhqm4clidlgas18cn1rtsk60p49zizy4ao13sf-eqscs0xjlbad-lkvskk8t7ga LQ5DIRGXBQQ_TAESSASJJ210VIQTQ "  (() > (->lasttime + 7200 = "Https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".->appid. " &secret= ".- =->https_request ( = Json_decode (,  ->access_token =["Access_token" ->lasttime =      Get_user_list (=  = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=".->access_token. " &next_openid= ". =->https_request ( Json_decode (,     Get_user_info (  = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=".->access_token. " &openid= ".." &AMP;LANG=ZH_CN " =->https_request ( Json_decode (,     Create_menu (  = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=".- =->https_request (, Json_decode (,     Send_custom_message (,,  =(' touser ' = (  ' Text ': [' msgtype '] = ' text ' [' text '] =(' content ' =(   = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=".-  ->https_request (,(Json_encode (     Create_qrcode (,  (  ' Qr_limit_scene ': = ' {' action_name ': ' Qr_limit_scene ', ' action_info ': {' SCENE ': {' scene_id ': '..'}}}'  ' Qr_scene ': = ' {"expire_seconds": 1800, "Action_name": "Qr_scene", "Action_info": {"SCENE": {"scene_id": '..'}}}'   = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=".- =->https_request (, = Json_decode (, "Https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".(["Ticket"     Create_group (  = ' {' group ': {' name ': '..'"}}' = "https://api.weixin.qq.com/cgi-bin/groups/create?access_token=".- =->https_request (, Json_decode (,     Update_group (,  = ' {' OpenID ': '.. ' "," to_groupid ": '..'}' = "https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token=".- =->https_request (, Json_decode (,     Upload_media (,  =("Media" = "@".)().' \\'. = "http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token=".->access_token. " &type= ". =->https_request (, Json_decode (,     Https_request (,=  =curl_setopt (, Curlopt_url,curl_setopt (, Curlopt_ssl_verifypeer,curl_setopt (, Curlopt_ssl_verifyhost, (!(curl_setopt (, Curlopt_post, 1curl_setopt (, Curlopt_postfields, curl_setopt (, Curlopt_returntransfer, 1 = Curl_exec (Curl_close (   }

< span="">

Call Method:

Initializing objects

< span="">< span="">Class_weixin_adv ("wx6222221b11111111", "3079cb22ad383ae7371d12aed1b2d0cc");

View Access Tokens

< span="">(< span="">->access_token);

Create two-dimensional code

< span="">(< span="">->create_qrcode ("Qr_scene", "134324234"));

Get a list of followers

< span="">(< span="">->get_user_list ());

Get user Information

< span="">= "Olvppjkttuztbwdwn7vjhnlqsmps"< span="">< span="">(< span="">->get_ User_info (< span="">));

Create a Menu

< span="">= ' {' button ': [{' Name ': ' Double studio ', ' Sub_button ': [{' Type ': ' Click ', ' Name ': ' Company profile ', ' key ': ' Company Profile '},{' type ': ' Click ', ' Name ': "Social responsibility", "key": "Social Responsibility"},{"type": "click", "Name": "Contact Us", "key": "Contact Us"}]},{"name": "Product Service", "Sub_button": [{"Type": "click "," name ":" Platform "," key ":" Platform "},{" type ":" click "," Name ":" Weibo app "," key ":" Weibo app "},{" type ":" click "," Name ":" Mobile website "," Key ":" Mobile website "}]},{" "Name": "Technical Support", "Sub_button": [{"Type": "click", "Name": "Document Download", "key": "Document Download"},{"type": "click", "Name": "Technical community "," Key ":" Technical Community "},{" type ":" click "," Name ":" Service Hotline "," Key ":" Service Hotline "}]}]} '< span="">< span="">(  < span=""> ->create_menu (< span="">));

User grouping< span="">

< span="">< span="">(->create_group ("Teacher"< span="">< span="">< span="">(->update_ Group (< span="">, "100"));

Upload and download Multimedia

< span="">(< span="">->upload_media ("image", "pondbay.jpg"));

Send a customer service message

< span="">(< span="">->send_custom_message (< span="">, "text", "ASDF"));

=========================================================

Double Studio public Platform account attention method:
1. Contacts-Add Friends-Find public number-search "double Studio"
2. Contacts-Add Friends-Search number-enter "Pondbaystudio"
3. Use the QR code below to scan

http://www.bkjia.com/PHPjc/763567.html www.bkjia.com true http://www.bkjia.com/PHPjc/763567.html techarticle This article introduces the PHP SDK and how to use the custom menu and advanced interface of the public platform. Author Fang Double Studio revision record: 2014.05.03 v1.0 SDK Source code: = "" = "" __cons ...

  • Related Article

    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.