[bd] API

[bd] API 1.6.3

No permission to download
Can I use this to synch accounts & user upgrades for members between sites?

i.e. A member can log into site A and purchase a user upgrade, which will then also be active on site B
Just answered your question here https://xfrocks.com/api-support/thr...er-upgrades-between-multiple-xf-installs.557/

I have added XenForo provider support (using [bd] Api) for the PHP League's OAuth 2.0 Client.
It can be useful, if someone want to create authentication between XenForo forum and own project, based on frameworks like Symfony, or Laravel.
Awesome work (y)
 
[bd]API 1.5.1: i have Millions of this in the error log:

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Column 'user_id' in field list is ambiguous - library/Zend/Db/Statement/Mysqli.php:77

#0 /var/www/xxx/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT * FROM `...')
#1 /var/www/xxx/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT * FROM `...')
#2 /var/www/xxx/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('SELECT * FROM `...')
#3 /var/www/xxx/library/Zend/Db/Adapter/Abstract.php(753): Zend_Db_Adapter_Abstract->query('SELECT * FROM `...', Array)
#4 /var/www/xxx/api.php(4426): Zend_Db_Adapter_Abstract->fetchRow('SELECT * FROM `...')
#5 /var/www/xxx/api.php(2106): XenAPI->getGroup('?' UNION ALL SE...')
#6 /var/www/xxx/api.php(56): RestAPI->processRequest()
#7 {main}
 
[bd]API 1.5.1: i have Millions of this in the error log:

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Column 'user_id' in field list is ambiguous - library/Zend/Db/Statement/Mysqli.php:77

#0 /var/www/xxx/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT * FROM `...')
#1 /var/www/xxx/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT * FROM `...')
#2 /var/www/xxx/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('SELECT * FROM `...')
#3 /var/www/xxx/library/Zend/Db/Adapter/Abstract.php(753): Zend_Db_Adapter_Abstract->query('SELECT * FROM `...', Array)
#4 /var/www/xxx/api.php(4426): Zend_Db_Adapter_Abstract->fetchRow('SELECT * FROM `...')
#5 /var/www/xxx/api.php(2106): XenAPI->getGroup('?' UNION ALL SE...')
#6 /var/www/xxx/api.php(56): RestAPI->processRequest()
#7 {main}
Those are not from this add-on FYI.
 
Thanks a ton.
So I have just played around with IFTTT Maker channel and this is how I configured IFTTT to create a new thread every time I like a tweet:

Screen Shot 2017-03-02 at 2.02.51 PM.webp

Basically you just need to select POST as method, and application/x-www-form-urlencoded as content type. Then enter the API url, here I used "https://xfrocks.com/api/index.php?threads/&forum_id=23&oauth_token=xxx" which is the url to create a new thread for forum #23 (the IFTTT demo forum) and a valid oauth_token. In the body, I used the tweet link as the new thread title and the full tweet text as the first post body.

See the threads created with this applet here: https://xfrocks.com/api-support/forums/bd-api-ifttt-demo.23/
 
xfrocks updated [bd] API with a new update entry:

Feature Update

  • Added param reason for post/thread/profile post deletion
  • Added latest_posts into thread data
  • Added latest_comments into profile post data
  • Added timeline_username into profile post data
  • Added user_followers_total and user_followings_total into user data
  • Added username into associatable user data
  • Added user_unread_notification_count for alert ping
  • Added support for thread prefixes
  • Added support for social accounts association (Facebook, Google)
  • Improved...

Read the rest of this update entry...
 
Nice!

I've been using [bd]API for a custom WordPress integration that I built, and it made development a LOT easier. :D Keep up the great work, I'll be installing this update soon.
 
upload_2017-4-4_22-21-58.webp

What is PubSubHubbub? :D

Furthermore, the scope descriptions when creating a tokens are empty:
upload_2017-4-4_22-28-58.webp
 
Last edited:
Is there a sample request on how to authenticate a user using their board credentials? I haven't found anything in the documentation, unfortunately.

I'm always getting a 404 NotFound when calling either /api/oauth/authorize or /api/oauth/token
 
Last edited:
Furthermore, the scope descriptions when creating a tokens are empty:
View attachment 150763
That bug has been fixed, future release should have those displaying correctly.

Could you update the bundled copy of oauth2-server-php? 1.7.0 is two years old, and I just ran into a problem caused by deprecation of mcrypt_create_iv in PHP 7.1 (fixed in https://github.com/bshaffer/oauth2-server-php/pull/773).

It would also be a good idea to move away from mcrypt altogether at some point.
That pull request was actually made by us. New release should be available soon and include that fix.

Is there a sample request on how to authenticate a user using their board credentials? I haven't found anything in the documentation, unfortunately.

I'm always getting a 404 NotFound when calling either /api/oauth/authorize or /api/oauth/token
Just use standard OAuth requests for tokens and you should be fine. Also, the url should be /api/index.php?oauth/authorize, /api/index.php?oauth/token unless you setup url rewrite yourself. But normally the system will use full url for best compatibility.
 
Are you logged in while browsing to this site? Because I get a "Invalid or expired access-token" when browsing this endpoint on my forum.

Not logged in, all endpoints send all the data .. lol

I hope there's a solution to this.
@xfrocks

Mehdi
 
Last edited:
If you remove member list permission from the guest / unregistered group, it will stop returning users.

Nope @xfrocks , it still displays the user's list in the api after putting "Never" to Members list for Unregistered..
Also, how about threads ? I don't want to hide my threads from unregistered just for the api to work.

Mehdi
 
Nope @xfrocks , it still displays the user's list in the api after putting "Never" to Members list for Unregistered..
Also, how about threads ? I don't want to hide my threads from unregistered just for the api to work.

Mehdi
If you want to prevent people from getting your public data, it's best to turn on the option Restrict Access. That way only app that has valid client will be able to access.
 
Top Bottom