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.
API not working
prakashraman
New
I have been trying all day to get the API to work on my Vanilla Forum (Community Edition). I am not entirely sure if the API is available for this version or it is only with one of the paid plans. Documentation does not seem clear enough.
Does anyone know what might be going on or have I set it up wrong ?
Tagged:
0
Comments
which API?
grep is your friend.
Welcome to the community!
What version of Vanilla are you running?
I believe you are referring to the API that lets you post to Vanilla. If this is the case, it is only available to hosted forums.
However, a community regular named kasper created an Vanilla API application and released it here in the addons.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks for the replies.
Vanilla Details:
I am trying to run the API's from http://vanillaforums.com/blog/api/
Intention:
I have a wordpress website. And I want to create a discussion for each post that is created (programatically). And I want to display the discussion in the wordpress post's page.
I tried running this API
/api/v1/categories/list.json
And got the following error (see attachment)
That page doesn't pertain to this community supported application. You are looking at the wrong documentation. If it worked at all, it was merely a coincidence.
You can find the documentation in the
/docs/build
folder.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Ah I see.
And where is the /docs/build folder ? In the extracted vanilla zip there does not exist a "docs" folder (see attachment)
In the Vanilla API addon zip you downloaded.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hmm.. So I looked at it. Could not really find any example/usage. From what I understand the an api would be
http://domain.com/api/categories
But still getting the same error.
My API application is only compatible with Vanilla 2.1 as it uses some new methods of the
Gdn_Request()
, methods that weren't introduced until 2.1. As of v0.0.7-dev (currently on thedevelop
branch) I've also removed the Sami-generated documentation as it merely bloated the repo. I plan on releasing some thorough docs once a stable version is out, but it could take a while as my job keeps me rather busy.Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Hi Kasper.
I see. Well I guess, I will have to stick to the 2.0.18.8 version I have.
In case, maybe you could help me, or point me in the right direction. I want to be able to programatically create discussions into the forum. Any good place for me to start ?
Is the WordPress site you're trying to create discussions from hosted on the same server, meaning you can access Vanilla files from WordPress, or is it hosted remotely?
Add Pages to Vanilla with the Basic Pages app
Yes both are on the same server. I will be able to access Vanilla files.
You don't need an API mapper (which my application as well as the internal one (Simple API) actually are) to make API calls. You can in fact simply do a GET to, say,
http://example.com/discussions.json
or a POST tohttp://example.com/post.json/discussion
. This should work for all controllers throughout Garden.Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
Thats great Didn't even know it existed. Where could I find the documentation for these REST calls ?
To the wiki!
http://vanillawiki.homebrewforums.net/index.php/Vanilla_API
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks These seem to be only READ apis right ? Can there any using which I create discussions ? As I'd like to create them automatically for each post.
You will have to figure out what data needs to be sent via a POST request for the discussion. You can figure out what is needed by opening
/applications/vanilla/controllers/class.postcontroller.php
and see what is checked in theDiscussion()
method.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.