1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 微信API整理(1)——微信常用API

微信API整理(1)——微信常用API

时间:2019-01-22 22:11:54

相关推荐

微信API整理(1)——微信常用API

整理一下微信API文档,以备未来开发,本文API内容为常用的微信开发API整理,内容有待完善......

package cn.vision.weixindemo.utils.base.API;public class WeiXin_API {// 授权类/*** 获取授权Token* https请求方式: GET* 字段必填 备注* grant_type是 获取access_token填写client_credential* appid 是 第三方用户唯一凭证* secret 是 第三方用户唯一凭证密钥,即appsecret** by Vision*/public static String API_GET_ACCESS_TOKEN = "https://api./cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";// 菜单类/*** 创建菜单* http请求方式:POST(请使用https协议)* 字段 必填 备注* button 是 一级菜单数组,个数应为1~3个* sub_button 否 二级菜单数组,个数应为1~5个* type 是 菜单的响应动作类型,view表示网页类型,click表示点击类型,miniprogram表示小程序类型* name 是 菜单标题,不超过16个字节,子菜单不超过60个字节* key click等点击类型必须 菜单KEY值,用于消息接口推送,不超过128字节* url view、miniprogram类型必须 网页 链接,用户点击菜单可打开链接,不超过1024字节。 type为miniprogram时,不支持小程序的老版本客户端将打开本url。* media_id media_id类型和view_limited类型必须调用新增永久素材接口返回的合法media_id* appid miniprogram类型必须小程序的appid(仅认证公众号可配置)* pagepath miniprogram类型必须 小程序的页面路径** by Vision*/public static String API_POST_CREATE_MENU = "https://api./cgi-bin/menu/create?access_token=ACCESS_TOKEN";/*** 查询菜单*http请求方式:GET* 字段 必填 备注* access_token是微信开发者授权token* by Vision*/public static String API_GET_QUERY_MENU = "https://api./cgi-bin/menu/get?access_token=ACCESS_TOKEN";/*** 删除菜单* 字段 必填 备注* access_token是微信开发者授权token* by Vision*/public static String API_GET_DELETE_MENU = "https://api./cgi-bin/menu/delete?access_token=ACCESS_TOKEN";//个性化菜单/*** 预留*///IP类/*** 获取微信服务器ip* 字段 必填 备注* access_token是微信开发者授权token* by Vision*/public static String API_GET_GETCALLBACKIP ="https://api./cgi-bin/getcallbackip?access_token=ACCESS_TOKEN";// 客服类/*** 添加客服账号* http请求方式: POST**"kf_account" : "test1@test",*"nickname" : "客服1",*"password" : "pswmd5",** by Vision*/public static String API_POST_ADDKF = "https://api./customservice/kfaccount/add?access_token=ACCESS_TOKEN";/*** 修改客服账号* http请求方式: POST**"kf_account" : "test1@test",*"nickname" : "客服1",*"password" : "pswmd5",** by Vision*/public static String API_POST_UPDATEKF = "https://api./customservice/kfaccount/update?access_token=ACCESS_TOKEN";/*** 删除客服账号* http请求方式: GET*"kf_account" : "test1@test",*"nickname" : "客服1",*"password" : "pswmd5",** by Vision*/public static String API_GET_DELETEKF = "https://api./customservice/kfaccount/del?access_token=ACCESS_TOKEN";/*** 上传客服头像* http请求方式: POST/FORM** 调用示例:使用curl命令,用FORM表单方式上传一个多媒体文件,curl命令的具体用法请自行了解** by Vision*/public static String API_POST_KFHEADIMG = "http://api./customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT";/*** 客服发送消息* http请求方式: POST* 不同的消息类型需要提交不同的参数,具体请查阅官方文档** by Vision*/public static String API_POST_KFCONTEXT = "https://api./cgi-bin/message/custom/send?access_token=ACCESS_TOKEN";/*** http请求方式: POST* 开发者可通过调用“客服输入状态”接口,返回客服当前输入状态给用户。* 字段 必填 备注* access_token 是 调用接口凭证* touser 是 普通用户(openid)* command 是 "Typing":对用户下发“正在输入"状态 "CancelTyping":取消对用户的”正在输入"状态* by Vision*/public static String API_POST_KF_TYPING = "POST https://api./cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN";//模板消息类/*** 设置所行业* http请求方式: POST** 参数 是否必须 说明* access_token 是 接口调用凭证* industry_id1 是 公众号模板消息所属行业编号* industry_id2 是 公众号模板消息所属行业编号** 编号消息请查阅官方文档* by Vision*/public static String API_POST_SET_INDUSTRY = "https://api./cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN";/*** 获取设置的行业信息* http请求方式:GET** 参数 是否必须 说明* access_token 是 接口调用凭证** by Vision*/public static String API_GET_INDUSTRY = "https://api./cgi-bin/template/get_industry?access_token=ACCESS_TOKEN";/*** 获得模板ID* http请求方式: POST** 参数是否必须 说明* access_token 是 接口调用凭证* template_id_short是 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式* by Vision*/public static String API_GET_TEMPLATE = "https://api./cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN";/*** 获取模板列表* http请求方式:GET* https://api./cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN** 参数 是否必须 说明* access_token 是 接口调用凭证*/public static String API_GET_ALL_PRIVATE_TEMPLATE = "https://api./cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN";/*** 删除模板* http请求方式:POST* https://api./cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN** 参数 是否必须 说明* access_token 是 接口调用凭证* template_id 是 公众帐号下模板消息ID*/public static String API_POST_DEL_PRIVATE_TEMPLATE = "https://api./cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN";/*** 发送模板消息* http请求方式: POST* https://api./cgi-bin/message/template/send?access_token=ACCESS_TOKEN* 参数 是否必填 说明* touser 是 接收者openid* template_id 是 模板ID* url 否 模板跳转链接* miniprogram 否 跳小程序所需数据,不需跳小程序可不用传该数据* appid 是 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏)* pagepath 否 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),暂不支持小游戏* data 是 模板数据* color 否 模板内容字体颜色,不填默认为黑色**/public static String API_POST_SENDTEMPLATE = "https://api./cgi-bin/message/template/send?access_token=ACCESS_TOKEN";// 自动回复类/*** http请求方式: GET(请使用https协议)* https://api./cgi-bin/get_current_autoreply_info?access_token=ACCESS_TOKEN* 具体参数请查阅官方文档*/public static String API_GET_CURRENT_AUTOREPLY_INFO = "https://api./cgi-bin/get_current_autoreply_info?access_token=ACCESS_TOKEN";}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。