The custom menu and advanced interface PHPSDK of the public platform. This document introduces the PHPSDK and usage of custom menus and advanced interfaces of the public platform. Author Fang times studio revision record: 2014.05.03v1.0SDK source code :__ cons This article introduces the php sdk and usage of the public platform custom menu and advanced interface.
Author
Fang times Studio
Correction Record:
2014.05.03 v1.0
SDK source code:
= "" = "" __construct( = , = ( ->appid = ( ->appsecret = ->lasttime = 1395049256 ->access_token = "nRZvVpDU7LxcSi7GnG2LrUcmKbAECzRf0NyDBwKlng4nMPf88d34pkzdNcvhqm4clidLGAS18cN1RTSK60p49zIZY4aO13sF-eqsCs0xjlbad-lKVskk8T7gALQ5dIrgXbQQ_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=".."&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, 1 curl_setopt(, CURLOPT_POSTFIELDS, curl_setopt(, CURLOPT_RETURNTRANSFER, 1 = curl_exec( curl_close( }
Call method:
Initialization object
= class_weixin_adv("wx6222221b11111111", "3079cb22ad383ae7371d12aed1b2d0cc");
View Access Token
(->access_token);
Create QR code
(->create_qrcode("QR_SCENE", "134324234"));
Retrieve the list of referers
(->get_user_list());
Obtain user information
= "oLVPpjkttuZTbwDwN7vjHNlqsmPs"(->get_user_info());
Create menu
= '{"Button": [{"name": "", "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 application", "key": "weibo application" },{ "type ": "click", "name": "Mobile website", "key": "Mobile website"}] },{ "name": "technical support", "sub_button ": [{"type": "click", "name": "document download", "key": "document download" },{ "type": "click ", "name": "Technology Community", "key": "Technology Community" },{ "type": "click", "name": "service hotline ", "key": "service hotline"}]} '(-> create_menu ());
User Group
(-> Create_group ("instructor" (-> update_group (, "100 "));
Upload and download multimedia
(->upload_media("image","pondbay.jpg"));
Send customer service message
(->send_custom_message(, "text", "asdf"));
========================================================== ========================
Follow-up methods for fanwe public platform accounts:
1. address book-add friends-search for public accounts-Search for "fangtimes studio"
2. address book-Add Friend-search number-enter "pondbaystudio"
3. scan the following QR code
Development SDK and usage. Author Fang times studio revision record: 2014.05.03 v1.0 SDK source code: = "" = "" _ cons...