Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Fully functional API

edited March 2012 in Vanilla 2.0 - 2.8

Is there any way to have a fully functional API for vanilla that would:

Allow to submit new discussions and comments as well as delete existing ones in an elegant manner (without pretending to be a webform or God knows what)

Get more specific data, such as n latest posts forumwide or per category

Existing API, as described by documentation, although RESTFUL and elegant elegant, seems very very limited.

This is essential for me because I want to use this forum system for commenting on my main site, as well as a standalone forum at the same time. The forum would be a separate entity with only connection to the main site and/or other systems being HTTP json interface.

I did try an existing API plugin (version 0.2) by "eleith" but it didn't work. After enabling it as an application in dashbord, the forum itself stopped working correctly - whenever I access a discussion, I get this error message:

{"Code":256,"Exception":"Could not find a 'index' view for the 'discussion' controller in the 'apiaaa' application.|DiscussionController|FetchViewLocation|"}

So I am stuck without proper API access...

Tagged:

Comments

  • lucluc ✭✭

    I saw that a while back, maybe it will suit some of your needs:

    http://vanillaforums.org/discussion/17525/vanilla-rest-services

  • It is a very interesting question and unfortunately I don't have a proper answer for you.

    We are however working on documentation at this site:

    http://vanillawiki.homebrewforums.net/index.php/Main_Page

    I know, it's not an API, but maybe you can read some of the things you need for your goal.

    I have a question about the API application you tried to enable. On that site, are you using a custom theme, or do you use the default theme?

    I hope you see in the error message what the discussion controller is looking for. It's looking for a file called index and it should be in the view directory of your theme.

    I haven't seen the Vanilla CMS application, but I guess that it's using some of the Vanilla API as well... just informing you :-)

    There was an error rendering this rich post.

  • I need a way for external application (main website) to add discussions and comments to vanilla VIA HTTP API.

    These discussions and comments would be posted by users of main site. These users would have accounts automatically created in vanilla with same usernames (also via HTTP API call) once they register on main site.

    Discussions and comments would also be posted by anonymous users without any accounts.

    As far as data modification goes, I would need at least four methods:

    Add user (username, e-mail, password (unencrypted?))
    Add discussion (category id, title, body, author's name)
    Add comment (discussion id, body, author's name)
    Delete discussion (discussion id)

    These methods would also have some sort of transient hash key for protection.

    The API application/plugin that I tried to install does have methods for adding discussions and comments. But, as I explained before, - the addon does not work with current version of Vanilla.

    How difficult would it be to write such a plugin/application and is it a bad idea/solution from the start?

  • @UnderDog

    I used clean install of vanilla forum + this API application. It did not have any view files - no views folder at all. After all - all views return JSON - i see no point in view files.

Sign In or Register to comment.