HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

UPDATE: How to make this work with current builds of Vanilla (2.0.18.4)

After a long session of Googling, I've got this working on an up to date build of Vanilla. There are all sorts of problems with the documentation and the links on this plugin/app's page.

First off, as pointed out in some other comments, the author forgot to add "0" before the latest version number, so the big "Download Now" link goes to an outdated build. Version ".2" is the latest if you go by the dates, so download that to start things off.

Secondly, version ".2" is missing some files, apparently, as when I extracted it to my "/vanilla/applications" it didn't show up on Vanilla's dashboard, so I couldn't 'enable' it. To fix this, I created a new application folder based off of the skeleton folder that is at "/vanilla/applications/skeleton." Then, I merged the folder that version ".2" of this plugin/app with my newly created skeleton folder. Finally, the app showed up in the dashboard, but I got the error that this post is complaining about ("no 'index' view found").

To fix this, you need to create some empty index.php files. I don't know exactly what needs to be created, as I just downloaded an older version of this API (ironically, the one that the big "Download Now" link goes to), and then copied the "views" folder from that to "/vanilla/applications/views"

Whew. Anyway, it works now.

Comments

  • edited November 2012

    A little more detail on the install procedure

    download v0.2 from github:

    https://github.com/eleith/vanilla-api-addon/

    click on Downloads link on right side just beside Tags, above commits and choose zip file

    extract, rename folder "api", copy to

    vanillaRoot/applications

    login to admin, click on Addons/Applications in left side panel, enable "api"

    but: problem is that the views/ folder is missing from v0.2 so need to download v0.1.3

    download v0.1.3 from vanilla

    http://vanillaforums.org/get/542-api-json

    should be simple right? no! it is actually a gzip file so change the downloaded file's filetype from .zip to .gz and extract (if cancel download and click the Click Here To Download Now link you will get .gz)

    then copy the views folder to:

    vanillaRoot/applications/api

    test it:

    in your browser browse to

    http://127.0.0.1/vanilla/api/category

    and you should see output like:

    {"categories":[{"CategoryID":"-1","ParentCategoryID":"-1","TreeLeft":"1"," .....

    in your browser browse to

    http://127.0.0.1/vanilla/api/sessions

    and you should see output like:

    {"user{"TransientKey":"P2345KKZ2DC1","UserID":"1","Name":"admin","User":true},"FormSaved ....

  • Nice explanation -- I paraphrased my instructions quite a bit..lol.

    I hope these comments help out a few users. This really needs to get fixed -- took a LOT of messing around to figure out what was wrong. This API is really useful...it's too bad the documentation is non-existent.

  • Yes, nice explanation, but for me it doesn't work this way?

    So I downloaded version .2 and 1.3, copied "views" folder from 1.3 to .2, then installed the application and enabled it in the dashboard. So far so good.

    But as I browse to, say http://www.mysite.com/vanilla2/api/discussion I get this error: {"Code":256,"Exception":"Could not find a 'index' view for the 'discussion' controller in the 'api' application.|DiscussionController|FetchViewLocation|"}

    I checked for empty index.php files in the views' subfolders and they're all there.

    Am I missing something maybe? What's wrong?

  • this API is pretty redundant.

    you go the basic built in API, and @kasperisager 's API App.

    http://vanillaforums.org/addon/api-application

    grep is your friend.

  • Thanks. However API's aren't my strong point, so I'd need some help. How to generate a token for a user?

    Or is this a question for somewhere else?

Sign In or Register to comment.