2、引數類需要用自己企業號中的值
3、獲取token物件,token物件中含有accesstoken,以及有效時間(毫秒,一般為7200),實際專案中需要快取起來,以免超過介面呼叫次數。package com.kp.util;
/** * 引數api類*/
public class paramesapi
4、管理企業號部門常用的urlpublic static token gettoken(string corpid, string corpsecret) catch (jsonexception e) errmsg:{}", jsonobject.getint("errcode"), jsonobject.getstring("errmsg"));
}} return token;
}
// 建立部門位址
public static string create_url = "";
// 更新部門位址
public static string update_url = "";
// 刪除部門位址
public static string delete_url = "";
// 獲取部門列表位址
public static string getlist_url = "";
6、結果:/**
* 建立部門
* @param accesstoken
* @param name 部門名稱。長度限制為1~64個字元
* @param parentid 父親部門id。根部門id為1
* */
public static int createbyparentid(string accesstoken , string name , string parentid)";
string outputstr=string.format(postjson, name,parentid);
//建立部門
//建立部門
/*** 更新部門
* @param accesstoken
* @param name 部門名稱,長度限制為1~64個字元
* @param id 部門id
* */
public static int update(string accesstoken , string id , string name)";
string outputstr=string.format(postjson, id, name);
//建立部門
* 刪除部門
* @param accesstoken
* @param id 部門id
* */
public static int delete(string accesstoken , string id)else errmsg:{}",errcode,errmsg);
}} return errcode;
} /**
* 獲取部門列表
* @param accesstoken
* */
@suppresswarnings()
public static listgetlist(string accesstoken)else errmsg:{}",errcode,errmsg);
}} return weixindepartment;
}
微信企業號開發 UserAgent
useragent 屬性是乙個僅僅讀的字串,宣告了瀏覽器用於 http 請求的使用者 頭 使用useragent能夠推斷使用者訪問的瀏覽器資訊。事實上jquery1.10之前的版本號就是依據這個推斷瀏覽器的。幾條手機的useragent 能夠看到不但能得到手機型別蘋果還是android手機。還能得到...
微信企業號開發和配置
服務號 需要工商營業執照,沒有。企業號 試了還行,能夠實現接收訊息 處理 返回。是我要找的。1 響應請求的servlet 2 token,隨機生成 3 encodingaeskey 隨機生成 4 先停下來,下面部署自己的 服務 第二部分 在 servlet的get方法編寫 import com.qq...
微信企業號開發中文亂碼問題
用本機tomcat執行專案 然後通過企業號介面發news給使用者就不會中文亂碼 不知道為什麼部署到學校的伺服器上給使用者發訊息就會亂碼?很迷。後來通過搜了很多資料發現 原本 是 inputstreamreader isr new inputstreamreader connection.getinp...