The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#4
|
|||
|
|||
![]() Quote:
Can you please help me on creating the api_sig in vB4 using C#. I am getting this error: invalid_api_signature. I am using the below C# code Code ============= apiVersion = HttpUtility.UrlEncode(apiVersion); apiAccessToken = HttpUtility.UrlEncode(apiAccessToken); vBulletinVersion = HttpUtility.UrlEncode(vBulletinVersion); apiClientId = HttpUtility.UrlEncode(apiClientId); secret = HttpUtility.UrlEncode(secret); apiKey = HttpUtility.UrlEncode(apiKey); using(MD5 md5Hash = MD5.Create()) { md5Password = GetMD5Hash(md5Hash, password); } string login_string = "api_m=login_login" + "&vb_login_username=" + userName + "&vb_login_md5password=" + md5Password; using (MD5 md5Hash = MD5.Create()) { api_sig = GetMD5Hash(md5Hash, login_string + apiAccessToken + apiClientId + secret + apiKey); api_sig = HttpUtility.UrlEncode(api_sig); } String login_request = "vb_login_username=" + userName + "&vb_login_md5password=" + md5Password + "&cookieuser=true"; String request = "?api_c=" + apiClientId + "&api_v=" + apiVersion + "&api_m=login_login" + "&api_s=" + apiAccessToken + "&api_sig=" + api_sig; url = url + request; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = login_request.Length; CookieContainer a = new CookieContainer(); req.CookieContainer = a; System.Net.ServicePointManager.Expect100Continue = false; // prevents 417 error using (StreamWriter writer = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII)) { writer.Write(login_request); } response = (HttpWebResponse)req.GetResponse(); using (StreamReader reader = new StreamReader(response.GetResponseStream())) { //cookie = reader.ReadToEnd(); JavaScriptSerializer js = new JavaScriptSerializer(); jsonResp = js.Deserialize<Dictionary<string, object>>(reader.ReadToEnd()); } Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|