Go Back   vb.org Archive > vBulletin 5 Connect Discussion > vB5 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2013, 06:21 PM
bravura bravura is offline
 
Join Date: Dec 2013
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 12-10-2013, 06:51 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bravura View Post
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 View Post
Is there any APIs which will be helpful ?
vBulletin Mobile API
http://www.vbulletin.com/vbcms/conte...334-mobile-api

vBulletin Source
/includes/api/
Reply With Quote
Благодарность от:
bravura
  #3  
Old 12-10-2013, 07:23 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is not a article, it's a question.
Reply With Quote
  #4  
Old 12-11-2013, 12:13 PM
bravura bravura is offline
 
Join Date: Dec 2013
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05694 seconds
  • Memory Usage 2,202KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (1)post_thanks_box_bit
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete