sample code
hi,
the link posted inside "Help with authentication" has been removed. can anyone please post any sample code which does authentication / posting once again?
thanks!
the link posted inside "Help with authentication" has been removed. can anyone please post any sample code which does authentication / posting once again?
thanks!
Tagged:
0
Answers
all the calls that need authentication require having a transient key, you can get that by making a call to this controller: https://github.com/eleith/vanilla-api-addon/blob/master/controllers/class.sessioncontroller.php
so basically, after the user has logged in (or you have some sort of single sign on implemented), make a call to
/api/session
what you get back is the users transientkey. (a generated string that will work for that session)
then make a call to any other controllers and pass that key in
/api/discussion/add (POST:Discussion/CategoryID, Discussion/Body, Discussion/Name, Discussion/TransientKey)
the above are the key values you need to pass in form that call, you can see the other apis supported here: https://github.com/eleith/vanilla-api-addon
sorry, this is not fully documented, i don't use it anymore so haven't had the need. i don't even know if it works with recent versions of vanilla. feel free to push updates if you want to better document it!
http://vanillaforums.org/docs/api
grep is your friend.
why not use
GET /post/discussion
pick up transient key then
POST
/post/discussion
That is the whole point of mating MCV with REST. It is not really REST if the resources are in different places.
grep is your friend.