[bd] API

[bd] API 1.6.3

No permission to download
Hi, could you provide an example authorization? I'm looking to build an automatic poster in Java (command is run in Minecraft, creates a new thread with information).

Thanks!
For your use case, probably best to authenticate via AdminCP (create new token with read, post scopes and very long TTL) then use it to create the thread. Below is an example to create the thread using curl:

Code:
curl -XPOST http://domain.com/xenforo/api/threads -d 'oauth_token=xxx&forum_id=2&thread_title=Test&post_body=Hello+world'
 
This add-on can be used with [bd] API Consumer to provide Single Sign On feature for example. Or it can be used with other external system (game, desktop app, mobile app) and let users from those system to interact with XenForo.
 
So if I have two websites, I can integrate both of them together using this? Users can login onto 1 and be logged onto another? Is this like a bridge then? What about logging into different systems like Joomla, Wordpress, or even a completely different forum software?
 
So if I have two websites, I can integrate both of them together using this?
Yes.

Is this like a bridge then?
Yes. Actually it's more than a bridge. The external site will be able to get data (get user info, get threads, etc.) and post data (register new user, create new thread, etc.)

What about logging into different systems like Joomla, Wordpress, or even a completely different forum software?
Possible. Here is a guide to login to XenForo from WordPress: https://xfrocks.com/api-support/threads/howto-authenticate-user-in-wordpress-with-xenforo.69/
 
Are you working on a new version or do you have already a new version?

I'm asking because i've run into several troubles with xenforo 1.2

e.g. some quick codesnippets (because i have no github account/access ATM)
Code:
  public function responseView($viewName, $templateName = 'DEFAULT', array $params = array(), array $containerParams = array())
   {
     throw new XenForo_Exception('bdApi_ControllerApi_Abstract::responseView() is not supported.');
   }

vs

Rich (BB code):
  public function responseView($viewName = '', $templateName = '', array $params = array(), array $containerParams = array())
   {
     throw new XenForo_Exception('bdApi_ControllerApi_Abstract::responseView() is not supported.');
   }


Code:
public function route(Zend_Controller_Request_Http $request)
   {
vs
Rich (BB code):
public function route(Zend_Controller_Request_Http $request, $routePath = null)
   {
 
Are you working on a new version or do you have already a new version?

I'm asking because i've run into several troubles with xenforo 1.2

e.g. some quick codesnippets (because i have no github account/access ATM)
Code:
  public function responseView($viewName, $templateName = 'DEFAULT', array $params = array(), array $containerParams = array())
   {
     throw new XenForo_Exception('bdApi_ControllerApi_Abstract::responseView() is not supported.');
   }

vs

Rich (BB code):
  public function responseView($viewName = '', $templateName = '', array $params = array(), array $containerParams = array())
   {
     throw new XenForo_Exception('bdApi_ControllerApi_Abstract::responseView() is not supported.');
   }


Code:
public function route(Zend_Controller_Request_Http $request)
   {
vs
Rich (BB code):
public function route(Zend_Controller_Request_Http $request, $routePath = null)
   {
Yes, this issue is known and fixed. A few features are being added and will be released soon. Sorry for the problem.
 
A few features are being added
Something like a lazy mapper?:D ( http://xenforo.com/community/threads/api-addon.58759/ )

e.g.

api/xenstorm/ => redirect everything to library/xenstorm/index controller
api/xenstorm/templates GET => eturn response from XenForo_ControllerADmin_Template::actionINdex
api/xenstorm/templates POST (this sucks, but because of the xenforo code, we have to use POST for this)=> return response from XenForo_ControllerAdmin_Template::actionSave

etc..:D


this would be extremly cool and avoid many copy and paste sessions from the original xenforo controllers to new API controllers:D
 
Something like a lazy mapper?:D ( http://xenforo.com/community/threads/api-addon.58759/ )

e.g.

api/xenstorm/ => redirect everything to library/xenstorm/index controller
api/xenstorm/templates GET => eturn response from XenForo_ControllerADmin_Template::actionINdex
api/xenstorm/templates POST (this sucks, but because of the xenforo code, we have to use POST for this)=> return response from XenForo_ControllerAdmin_Template::actionSave

etc..:D


this would be extremly cool and avoid many copy and paste sessions from the original xenforo controllers to new API controllers:D
That will not work well because normal controllers do a lot of unrelated stuff. For API controllers, it only need to call the datawriter so not much duplicated code actually.
 
I am trying to set my forum up to allow users to log into Xenforo by using Twitch.tv. I believe it should be possible with this add on, I am just having issues figuring out the proper parameters. Does anyone have any experience with using this add on to log into Xenforo by authenticating through Twitch.tv or know if it is possible and someone could point me in the right direction?

Ideal situation: Users come to my forum, click login/register via Twitch.tv. The forum sends them to Twitch to allow my forum access to their twitch.tv account, once access has been granted, it goes back to xenforo to finish the registration using their twitch.tv username as the username for xenforo. Then from then on, they can just click login with Twitch.tv from the login window, and as long as they are logged in on Twitch, they automatically get logged into the forum.

Again, from how I read and understood how this add-on works, I thought this functionality should be possible. Any help would be greatly appreciated.

Thanks
 
I am trying to set my forum up to allow users to log into Xenforo by using Twitch.tv. I believe it should be possible with this add on, I am just having issues figuring out the proper parameters. Does anyone have any experience with using this add on to log into Xenforo by authenticating through Twitch.tv or know if it is possible and someone could point me in the right direction?

Ideal situation: Users come to my forum, click login/register via Twitch.tv. The forum sends them to Twitch to allow my forum access to their twitch.tv account, once access has been granted, it goes back to xenforo to finish the registration using their twitch.tv username as the username for xenforo. Then from then on, they can just click login with Twitch.tv from the login window, and as long as they are logged in on Twitch, they automatically get logged into the forum.

Again, from how I read and understood how this add-on works, I thought this functionality should be possible. Any help would be greatly appreciated.

Thanks
No, it's the other way around. Use this add-on if you want to login to Twitch.TV using you XenForo account :D
 
I am trying to set my forum up to allow users to log into Xenforo by using Twitch.tv. I believe it should be possible with this add on, I am just having issues figuring out the proper parameters. Does anyone have any experience with using this add on to log into Xenforo by authenticating through Twitch.tv or know if it is possible and someone could point me in the right direction?

Ideal situation: Users come to my forum, click login/register via Twitch.tv. The forum sends them to Twitch to allow my forum access to their twitch.tv account, once access has been granted, it goes back to xenforo to finish the registration using their twitch.tv username as the username for xenforo. Then from then on, they can just click login with Twitch.tv from the login window, and as long as they are logged in on Twitch, they automatically get logged into the forum.

Again, from how I read and understood how this add-on works, I thought this functionality should be possible. Any help would be greatly appreciated.

Thanks
You may extend this: http://xenforo.com/community/resources/social-network-authentication-twitter-google-vk-com.645/
 
xfrocks updated [bd] API with a new update entry:

Feature update

v1.1 (28-09-2013)
  1. added support for HTTP header X-HTTP-Method-Override to override request method
  2. added password encryption
  3. added support for sticky thread
  4. added DELETE /posts/:postId/attachments/
  5. added support for attachment data
  6. added support for conversation and message
  7. fixed bugs
For full document, see
https://github.com/xfrocks/bdApi/blob/master/docs/api.markdown

For demo, try https://xfrocks.com/api

Read the rest of this update entry...
 
Hi, could you provide an example authorization? I'm looking to build an automatic poster in Java (command is run in Minecraft, creates a new thread with information).

Thanks!
For password grant type, you can execute this:

Code:
curl -XPOST http://domain.com/api/oauth/token -d 'grant_type=password&username=username&password=password&client_id=api_key'

You will get something like this from the server:

Code:
{"access_token":"xyz123","expires_in":3600,"scope":null,"refresh_token":"xyz456"}

You can now use "xyz123" in other requests like...

Code:
curl http://domain.com/api/users/me?oauth_token=xyz123
 
I've been going backward and forward trying to figure out if there is some way to get this to work with
http://www.persona.org

But I'm starting to think that this add-on needs some sort of support for outside (remote) verification.
 
Last edited:
I've been going backward and forward trying to figure out if there is some way to get this to work with
http://www.persona.org

But I'm starting to think that this add-on needs some sort of support for outside (remote) verification.
Well, this add-on is the other way around (let other sites authenticate using your site) instead of Persona (let your site authenticate using other sites). So it won't work.
 
Top Bottom