vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=262)
-   -   vBulletin 5 API Tutorial (https://vborg.vbsupport.ru/showthread.php?t=313991)

ibeauty 08-28-2014 02:08 PM

vBulletin 5 API Tutorial
 
I think that everybody here had experienced the vBulletin 5 documentation or rather its lack. I don't know if it wouldn't be cheaper to use another forum engine. Anyway I'd like to try to write some tutorial documentation on vB5 API since developers can't make even single page about this. (But they have time to answer on same question on their board over and over again).

I will gather all knowledge from this thread and publish it as an article for all of you. So if anybody knows anything about vB5 API please write it here.

I'll start.
================================================== =============
I think good place to start is here:
HTML Code:

http://www.vbulletin.com/vbcms/content.php/334-mobile-api
So far I had figure out that you can access you vB api under URL like:

HTML Code:

http://yoursite.com/api.php
or
HTML Code:

http://yoursite.com/forum/api.php
It depends if you have your forum in subfolder or direct under domains. I'll use the latter configuration.

You can call any function from /core/vb/api folder like this:

HTML Code:

http://yoursite.com/forum/api.php?api_m=classname.methodname
This is also first difference from vB4 API. In vB4 you called functions like this: classname_methodname

First thing to do is to call init function. With minimum set of parameters it looks like this:

HTML Code:

http://yoursite.com/forum/api.php?api_m=api.init&clientname=iBeauty&clientversion=0.1&platformname=iB&platformversion=0.7&uniqueid=12345
I don't know what exactly doe parameters mean. But without them you won't init api.
I don't know either why do I have generate API key in admincp.

So far I have some JSON answer. I'll write about further progress :cool:

Dead Eddie 08-29-2014 03:02 AM

Quote:

I don't know what exactly doe parameters mean. But without them you won't init api.
After the class/method identifier, it's basically just metadata about your application.

Quote:

I don't know either why do I have generate API key in admincp.
Further calls to the API require an "api_sig" parameter, which is an MD5'd hash of the URL parameters, your client's public token, your client's ID, your client's secret token, and the API key. So, it's there for security.

ibeauty 02-20-2015 02:16 PM

After a long long time and some stuff done I have commited this tutorial about vBulletin API:

http://onemanstudio.pl/tutorial/vbul...-api-tutorial/

It is not covering whole subject of API and how to do certain things. But it is a good example how to start with vB5 API. All of this is thrown over the internet, so I gathered it in one place.

Later I will add to it PHP Class that interacts with vB5 API, and maybe some more tutorials how do some things with API.


All times are GMT. The time now is 03:30 AM.

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.01012 seconds
  • Memory Usage 1,719KB
  • 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
  • (5)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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