转:http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index
新增永久素材
root@iZ23oylpvetZ:/var/www/html/weixin# curl -F media=@1.jpg "http://api.weixin.qq.com/cgi-bin/material/add_material?access_token=bq_OundF7Qm0LEcr4-AGU5WpLU4bbmSMPC3sp-sLm24Q4PZCDNpph4ElclXGcRK2SP8wsokfZZEzZ3NOBr7bje6Vb3bxgH6c55ZdUvYD5KM"
{"media_id":"8793923490"}
2038 ls -rthl
2040 curl -F media=@1.jpg "http://file.api.weixin.qq.com/cgi-bin/material/add_material?access_token=bq_OundF7Qm0LEcr4-AGU5WpLU4bbmSMPC3sp-sLm24Q4PZCDNpph4ElclXGcRK2SP8wsokfZZEzZ3NOBr7bje6Vb3bxgH6c55ZdUvYD5KM"
2044 curl -F media=@1.jpg "http://api.weixin.qq.com/cgi-bin/material/add_material?access_token=bq_OundF7Qm0LEcr4-AGU5WpLU4bbmSMPC3sp-sLm24Q4PZCDNpph4ElclXGcRK2SP8wsokfZZEzZ3NOBr7bje6Vb3bxgH6c55ZdUvYD5KM&type=image"
2048 curl https://api.weixin.qq.com/cgi-bin/material/get_materialcount?access_token=bq_OundF7Qm0LEcr4-AGU5WpLU4bbmSMPC3sp-sLm24Q4PZCDNpph4ElclXGcRK2SP8wsokfZZEzZ3NOBr7bje6Vb3bxgH6c55ZdUvYD5KM
root@iZ23oylpvetZ:/var/www/html/weixin#
获取永久素材
root@iZ23oylpvetZ:/var/www/html/weixin# curl "https://api.weixin.qq.com/cgi-bin/material/get_material?access_token=bq_OundF7Qm0LEcr4-AGU5WpLU4bbmSMPC3sp-sLm24Q4PZCDNpph4ElclXGcRK2SP8wsokfZZEzZ3NOBr7bje6Vb3bxgH6c55ZdUvYD5KM" -d '{"media_id":"8793924072"}' -o file2.jpg
http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html
http://www.cnblogs.com/txw1958/p/weixin71-oauth20.html
测试账号只能获取已经关注测试号人员的资料,而且要在微信里打开,服务号则无须关注 http://mp.weixin.qq.com/qa/14/6c1fb25f094658a4de6170e42515c926.html
http://blog.csdn.net/fuyifang/article/details/40707517 获取微信id
https://api.weixin.qq.com/sns/userinfo?access_token=OezXcEiiBSKSxW0eoylIeKBKZG5biSmp7d5jO9MvVz-U_eTAgdS8uVX5czQYwdeGWEQLCM5J6_26sSXhlD7MJkEH_-IIXLdp6eo1-ZlZS8_yb3wp0B-Oghx6YmH9AHotCGL7niDgNmbEkYlmbSKi6g&openid=o7qRAs_Y1a1Weitn10DaKTeWGRhk&lang=zh_CN
{"openid":"o7qRAs_Y1a1Weitn10DaKTeWGRhk","nickname":"思域","sex":1,"language":"zh_CN","city":"嘉定","province":"上海","country":"中国","headimgurl":"http:\/\/wx.qlogo.cn\/mmopen\/VV4EZK5Vg8ldjxkIe4gn0ROnibIGAc2f323QZXnGxAtE2CWYSApoIicxrfRnibocXQ5H8ZL6ChfSiadRFlfZgKBoV3aH4CI4VhQZ\/0","privilege":[]}
https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxa6e3818b0609ac91&secret=94cdcb500d5db42b934a1356427fdd42&code=041d481021367c39514d8f205cd1414p&grant_type=authorization_code
{"access_token":"OezXcEiiBSKSxW0eoylIeKBKZG5biSmp7d5jO9MvVz-U_eTAgdS8uVX5czQYwdeGWEQLCM5J6_26sSXhlD7MJkEH_-IIXLdp6eo1-ZlZS8_yb3wp0B-Oghx6YmH9AHotCGL7niDgNmbEkYlmbSKi6g","expires_in":7200,"refresh_token":"OezXcEiiBSKSxW0eoylIeKBKZG5biSmp7d5jO9MvVz-U_eTAgdS8uVX5czQYwdeG89kU-7X3EJkcHAoC8nUp3MacEnYT8WSRisfjyUYme-wgmj2CsvOEsaH7mSVE1nol11kISNlwdSh-LYb1ZkCsOg","openid":"o7qRAs_Y1a1Weitn10DaKTeWGRhk","scope":"snsapi_userinfo"} https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa6e3818b0609ac91&redirect_uri=http://120.26.44.201/oauth2.php&response_type=code&scope=snsapi_base&state=1&connect_redirect=1#wechat_redirect https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa6e3818b0609ac91&redirect_uri=http://120.26.44.201/oauth2.php&response_type=code&scope=snsapi_userinfo&state=1&connect_redirect=1#wechat_redirect