亚马逊 开发者api 调用_关于微信API:常用微信API文档整理
微信公眾平臺消息接口為開發者提供了一種新的消息處理方式。微信公眾平臺消息接口為開發者提供與用戶進行消息交互的能力。對于成功接入消息接口的微信公眾賬號,當用戶發消息給公眾號,微信公眾平臺服務器會使用HTTP請求對接入的網址進行消息推送,第三方服務器可通過響應包回復特定結構,從而達到回復消息的目的。本文內容就整理些常用的的微信開發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.weixin.qq.com/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.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN";
/**
* 查詢菜單
*http請求方式:GET
* 字段 必填 備注
* access_token 是 微信開發者授權token
* by Vision
*/
public static String API_GET_QUERY_MENU = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN";
/**
* 刪除菜單
* 字段 必填 備注
* access_token 是 微信開發者授權token
* by Vision
*/
public static String API_GET_DELETE_MENU = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN";
//個性化菜單
/**
* 預留
*/
//IP類
/**
* 獲取微信服務器ip
* 字段 必填 備注
* access_token 是 微信開發者授權token
* by Vision
*/
public static String API_GET_GETCALLBACKIP ="https://api.weixin.qq.com/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.weixin.qq.com/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.weixin.qq.com/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.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN";
/**
* 上傳客服頭像
* http請求方式: POST/FORM
*
* 調用示例:使用curl命令,用FORM表單方式上傳一個多媒體文件,curl命令的具體用法請自行了解
*
* by Vision
*/
public static String API_POST_KFHEADIMG = "http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT";
/**
* 客服發送消息
* http請求方式: POST
* 不同的消息類型需要提交不同的參數,具體請查閱官方文檔
*
* by Vision
*/
public static String API_POST_KFCONTEXT = "https://api.weixin.qq.com/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.weixin.qq.com/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.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN";
/**
* 獲取設置的行業信息
* http請求方式:GET
*
* 參數 是否必須 說明
* access_token 是 接口調用憑證
*
* by Vision
*/
public static String API_GET_INDUSTRY = "https://api.weixin.qq.com/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.weixin.qq.com/cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN";
/**
* 獲取模板列表
* http請求方式:GET
* https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN
*
* 參數 是否必須 說明
* access_token 是 接口調用憑證
*/
public static String API_GET_ALL_PRIVATE_TEMPLATE = "https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN";
/**
* 刪除模板
* http請求方式:POST
* https://api.weixin.qq.com/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.weixin.qq.com/cgi-bin/template/del_private_template?access_token=ACCESS_TOKEN";
/**
* 發送模板消息
* http請求方式: POST
* https://api.weixin.qq.com/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.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
// 自動回復類
/**
* http請求方式: GET(請使用https協議)
* https://api.weixin.qq.com/cgi-bin/get_current_autoreply_info?access_token=ACCESS_TOKEN
* 具體參數請查閱官方文檔
*/
public static String API_GET_CURRENT_AUTOREPLY_INFO = "https://api.weixin.qq.com/cgi-bin/get_current_autoreply_info?access_token=ACCESS_TOKEN";
}
更多關于微信API的信息,也可以咨詢99API了解。
總結
以上是生活随笔為你收集整理的亚马逊 开发者api 调用_关于微信API:常用微信API文档整理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: k8s ready 不调度_从零开始学K
- 下一篇: nanakon