[bd] API for XenForo 2.0 2.2.0 Beta 1

Power up your XenForo installation.

  1. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    pete likes this.
  2. hoangnamdoan33

    hoangnamdoan33 New Member

    add on này dugnf để làm gì anh
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      linhbtt likes this.
      1
  3. Warchamp7

    Warchamp7 New Member

    Is this cross compatible with the previous XF1 API @xfrocks or will client applications need to be updated?
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @Warchamp7 The API is designed to be backward compatible. Client apps shouldn't need updating to work.
       
      alfa1 likes this.
      1
    2. Warchamp7

      Warchamp7 New Member

      Warchamp7 @xfrocks Does that mean a XenForo 1 site running your XF1 Consumer add-on can sign in using this XF2 API?
       
    3. alfa1

      alfa1 Active Member

      alfa1 @xfrocks Can I have a bd API install on XF1 and have a bd API for XF2 consumer?
       
    4. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @alfa1 Yes you can do that.
       
  4. pete

    pete New Member

    Does this make any sense?

    [27/Mar/2018:22:54:04 +0100] "POST /bbs/api/index.php?batch&oauth_token=0%2C1522187654%2Cd69d4ba6a1dbb60507dabaf1c2034a80%2Chj2h4kocco HTTP/1.1" 404 70 "-" "-"
    [27/Mar/2018:22:54:57 +0100] "POST /bbs/api/index.php?batch&oauth_token=0%2C1522187706%2Cda05fcefff72bac2e8f809166faef714%2Chj2h4kocco HTTP/1.1" 404 70 "-" "-"
    [27/Mar/2018:22:55:18 +0100] "POST /bbs/api/index.php?batch&oauth_token=0%2C1522187728%2Cd88c69df389e9982fa41edec7073fbad%2Chj2h4kocco HTTP/1.1" 404 70 "-" "-"
    [27/Mar/2018:22:56:24 +0100] "GET /bbs/api/ HTTP/1.1" 200 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.45 Safari/537.36"
    [27/Mar/2018:22:56:36 +0100] "GET /bbs/api/index.php HTTP/1.1" 200 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.45 Safari/537.36"
    [27/Mar/2018:22:56:45 +0100] "GET /bbs/api/index.php?batch HTTP/1.1" 404 70 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.45 Safari/537.36"

    Wordpress consumer just says "Unable to determine API version."
     
  5. Warchamp7

    Warchamp7 New Member

    Anything I can modify to get some more verbose logging of what's going wrong on my end xfrocks?

    Your API is super valuable to us and one of two things left for me to test before I upgrade to XF2
     
  6. ciak2009

    ciak2009 New Member

    First I'd like to extend a hand of thanks for making such an awesome plugin @xfrocks ! I, like @Warchamp7 heavily rely on this plugin and I am currently running into that same 404 error on many of the XF endpoints. Any assistance is greatly appreciated!
     
  7. Warchamp7

    Warchamp7 New Member

    Hey @xfrocks, have you had a chance to look into this at all the last couple weeks?
     
  8. Rayduxz

    Rayduxz New Member

    I get this when trying to install it.

    Code:
    XF\Db\Exception: MySQL query error [1709]: Index column size too large. The maximum column size is 767 bytes. src/XF/Db/AbstractStatement.php:212
    Code:
    CREATE TABLE `xf_bdapi_auth_code` (
        `auth_code_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
        `client_id` VARCHAR(255) NOT NULL,
        `auth_code_text` VARCHAR(255) NOT NULL,
        `redirect_uri` TEXT NOT NULL,
        `expire_date` INT UNSIGNED NOT NULL,
        `user_id` INT UNSIGNED NOT NULL,
        `scope` TEXT NOT NULL,
        PRIMARY KEY (`auth_code_id`),
        UNIQUE KEY `auth_code_text` (`auth_code_text`)
    ) ENGINE = INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
    ------------
    
    #0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1709, 'HY000')
    #1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1709, 'HY000')
    #2 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
    #3 src/XF/Db/Schema/AbstractDdl.php(151): XF\Db\AbstractAdapter->query('CREATE TABLE `x...')
    #4 src/XF/Db/SchemaManager.php(164): XF\Db\Schema\AbstractDdl->apply()
    #5 src/addons/Xfrocks/Api/Setup.php(22): XF\Db\SchemaManager->createTable('xf_bdapi_auth_c...', Object(Closure))
    #6 src/XF/AddOn/StepRunnerInstallTrait.php(60): Xfrocks\Api\Setup->installStep1(Array)
    #7 src/XF/AddOn/StepRunnerInstallTrait.php(27): Xfrocks\Api\Setup->installStepRunner(1, Array)
    #8 src/XF/Admin/Controller/AddOn.php(390): Xfrocks\Api\Setup->install(Array)
    #9 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
    #10 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', 'html', Object(XF\Mvc\ParameterBag), 'listAddOns', Object(XF\Admin\Controller\AddOn), NULL)
    #11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
    #12 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
    #13 src/XF.php(328): XF\App->run()
    #14 admin.php(13): XF::runApp('XF\\Admin\\App')
    #15 {main}
    Code:
    array(4) {
      ["url"] => string(38) "/admin.php?add-ons/Xfrocks-Api/install"
      ["referrer"] => string(63) "https://example/admin.php?add-ons/Xfrocks-Api/install"
      ["_GET"] => array(1) {
        ["add-ons/Xfrocks-Api/install"] => string(0) ""
      }
      ["_POST"] => array(7) {
        ["_xfProcessing"] => string(1) "1"
        ["continue"] => string(1) "1"
        ["confirm"] => string(1) "1"
        ["params"] => string(2) "[]"
        ["count"] => string(1) "1"
        ["finished"] => string(1) "0"
        ["_xfToken"] => string(8) "********"
      }
    }
     
  9. Rayduxz

    Rayduxz New Member

    Hey @xfrocks , any ETA for fixing this? To be honest I bought the yearly license just for this :rolleyes:
     
  10. Warchamp7

    Warchamp7 New Member

    @Rayduxz He hasn't posted on here for any of April :/

    Hell, I just had to renew my upgrade for posting here to bump the thread. @xfrocks if you're going to charge for posting for support, I would appreciate a bit more info beyond "You actually got it installed?" :[
     
  11. Warchamp7

    Warchamp7 New Member

    Yet another week with no reply, probably going to have to just give up this functionality
     
  12. Rayduxz

    Rayduxz New Member

    Still no reply from @xfrocks :(
    I think I'm going to ask for a refund of my membership.
     
  13. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    We are releasing a new version of this add-on soon and it should fix the current installer issue. There will be 404 errors because the XF2 version doesn't have all features of XF1 version yet (they will be added gradually). I have added another month of Webmaster badge for all you guys to wait for that new release, sorry for the inconvenience.
     
  14. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    alfa1 likes this.
  15. Rayduxz

    Rayduxz New Member

    pete likes this.
  16. Warchamp7

    Warchamp7 New Member

    @xfrocks Much appreciated.

    I'm trying to test Alpha 2 using http://api-php-demo.xfrocks.com/setup.php and getting the following error

    upload_2018-6-1_23-16-17.png


    • League\OAuth2\Server\Exception\InvalidClientException: API: Client authentication failed.
    • src/addons/Xfrocks/Api/vendor/league/oauth2-server/src/Grant/AuthCodeGrant.php:105
    • Generated by: Warchamp7
    • Jun 1, 2018 at 11:13 PM
    Stack trace
    #0 src/addons/Xfrocks/Api/OAuth2/Server.php(263): League\OAuth2\Server\Grant\AuthCodeGrant->checkAuthorizeParams()
    #1 src/addons/Xfrocks/Api/XF/Pub/Controller/Account.php(126): Xfrocks\Api\OAuth2\Server->grantAuthCodeCheckParams(Object(Xfrocks\Api\XF\Pub\Controller\Account))
    #2 src/XF/Mvc/Dispatcher.php(249): Xfrocks\Api\XF\Pub\Controller\Account->actionAuthorize(Object(XF\Mvc\ParameterBag))
    #3 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'authorize', 'html', Object(XF\Mvc\ParameterBag), 'account', Object(Xfrocks\Api\XF\Pub\Controller\Account), NULL)
    #4 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
    #5 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
    #6 src/XF.php(328): XF\App->run()
    #7 index.php(13): XF::runApp('XF\\Pub\\App')
    #8 {main}

    Request state
    array(4) {
    ["url"] => string(152) "/account/authorize?response_type=code&client_id=7O-9-6Zq1R&scope=read&redirect_uri=http%3A%2F%2Fapi-php-demo.xfrocks.com%2Findex.php%3Faction%3Dcallback"
    ["referrer"] => string(41) "http://api-php-demo.xfrocks.com/index.php"
    ["_GET"] => array(5) {
    ["/account/authorize"] => string(0) ""
    ["response_type"] => string(4) "code"
    ["client_id"] => string(10) "7O-9-6Zq1R"
    ["scope"] => string(4) "read"
    ["redirect_uri"] => string(57) "http://api-php-demo.xfrocks.com/index.php?action=callback"
    }
    ["_POST"] => array(0) {
    }

    upload_2018-6-1_23-16-31.png
     
  17. Warchamp7

    Warchamp7 New Member

  18. xfrocks

    xfrocks XenForo rocks!
    Staff Member

  19. pete

    pete New Member

    OK. I've installed the beta, have 1.3.5 installed in wordpress, have the api key generated & entered in the WP plugin config. When I try to associate my WP Admin account with my xF Admin account i get this error in xF:

    "Oops! We ran into some problems.
    Invalid client."

    The URL in the xf API Log shows the correct API client ID, however the log entry itself says

    i.e. both are blank.


    I've tried a complete uninstall and reinstall, deleted (then reinstated) wp_xfac_auth, and i don't know what else could be wrong. I have a lot of user accounts linked from a previous version of BD[API] that i'd like to retain if at all possible.
     
    Foynat likes this.
  20. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Have you configured the redirect url correctly? What is your WordPress site address and what did you put as the redirect url? Try putting the WordPress domain into the whitelist maybe.
     
Loading...