HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla REST services
ddumont
✭✭
Are there currently any good docs on them? (Is this it, or do you have more: http://vanillaforums.org/docs/api)
Do you have js libraries to interface with them?
Do you have js libraries to interface with them?
There was an error rendering this rich post.
0
Best Answer
-
Todd Vanilla StaffAll of our controller methods can be obtained as a rest request. All you do is append
.json
or.xml
to the end of the method name.
Let's look at this discussion as an example. The url is http://vanillaforums.org/discussion/17525/vanilla-rest-services.
This maps to theDiscussionController->Index(...)
method with a discussion ID of 17525. So here is the rest request for the method:
http://vanillaforums.org/discussion.json/17525/vanilla-rest-services.
or
http://vanillaforums.org/discussion/index.json/17525/vanilla-rest-services.
You can also look at the controller method and pass the named arguments in as query-string parameters which I recommend, like this:
http://vanillaforums.org/discussion.json?discussionid=17525
While clicking these links, you may see that your browser prompts you to download. This is because we send back the correct content type ofapplication/json
. I recommend installing the Firefox extension called JSON view that will allow you to view the json more easily.0
Answers
.json
or.xml
to the end of the method name.Let's look at this discussion as an example. The url is http://vanillaforums.org/discussion/17525/vanilla-rest-services.
This maps to the
DiscussionController->Index(...)
method with a discussion ID of 17525. So here is the rest request for the method:http://vanillaforums.org/discussion.json/17525/vanilla-rest-services.
or
http://vanillaforums.org/discussion/index.json/17525/vanilla-rest-services.
You can also look at the controller method and pass the named arguments in as query-string parameters which I recommend, like this:
http://vanillaforums.org/discussion.json?discussionid=17525
While clicking these links, you may see that your browser prompts you to download. This is because we send back the correct content type of
application/json
. I recommend installing the Firefox extension called JSON view that will allow you to view the json more easily.There was an error rendering this rich post.