vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   Incorporating vBulletin within a Mobile App (https://vborg.vbsupport.ru/showthread.php?t=305710)

bravura 12-10-2013 06:21 PM

Incorporating vBulletin within a Mobile App
 
Hello,

We have a mobile app and would like to incorporate the vBulletin posts within our existing app. Can we do this? Is there any APIs which will be helpful ?

Thanks
debashis

tbworld 12-10-2013 06:51 PM

Quote:

Originally Posted by bravura (Post 2467404)
Can we do this?

I never know how to answer that question. It can be done. The company I work for has incorporated vbulletin in our company app. We only incorporated the parts of vbulletin we were interested in as we wanted it very specialized.
Quote:

Originally Posted by bravura (Post 2467404)
Is there any APIs which will be helpful ?

vBulletin Mobile API
http://www.vbulletin.com/vbcms/conte...334-mobile-api

vBulletin Source
/includes/api/

ozzy47 12-10-2013 07:23 PM

This is not a article, it's a question.

bravura 12-11-2013 12:13 PM

Quote:

Originally Posted by tbworld (Post 2467417)
I never know how to answer that question. It can be done. The company I work for has incorporated vbulletin in our company app. We only incorporated the parts of vbulletin we were interested in as we wanted it very specialized.


vBulletin Mobile API
http://www.vbulletin.com/vbcms/conte...334-mobile-api

vBulletin Source
/includes/api/

Thank you for your responce.
Now i am stuck with an error "invalid_api_signature " while trying to login.
I am doing the Integration using C#.
I called api_init and i got the apiversion, apiaccesstoken, vbulletinversion, apiclientid and secret.
Then i called login_login and passed apiclientid, apiversion, apiaccesstoken and api_sig as query string. I have passed vb_login_username and vb_login_md5password as content.

Please see the below C# code for creating the api_sig and for creating a http post request.

/////// C# 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());
}



Please help me on this. If it is wrong can you please give me some sample code for creating api_sig in C#. I have implemented this code in C# for creating api_sig by looking at one of the posts where the code was in PHP. Below is the link which i took as a reference for creating the api_sig.


https://vborg.vbsupport.ru/showthread.php?p=2321926%20





Thanks


All times are GMT. The time now is 02:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete