I and my team mate want to use Anahita as the social backend for our mobile app. We like to register users with the RESTful Api. I have searched for examples on how this is done in Anahita but can't find any. Can anyone help here or point me to the right documentation on Anahita RESTful Api?
Thanks, Victor
Powered by Anahita
Pavel Kulbakin
Rastin Mehr
Actions: read, add, post, and delete
Also look at how the authentication and registration forms work. You just need to add format=json to your requests.
In general all Anahita controllers provide BREAD operations (Browse, Read, Edit, Add, Delete) as well as additional actions that might exist in the controller. Following that convention, you should be able to understand the RESTful API in all controllers.
Victor Eberechi
Victor
Victor Eberechi
I'm using curl as a client to send the post request for now. This is just for testing and we will be using ajax calls in the mobile app. We keep getting the "Permissions denied page" after trying the below and a few more:
curl -X POST -H "Content-Type: application/json" -d '{"name":"foo foo","username":"foousername", "email":"foo@foomail.com", "password":"abcd123abcd"}' http:///index.php/people/person
curl --form "name=foo foo&username=foousername&email=foo@foomail.com&password=abc123abc123&format=json" http:///index.php/people/person
We have tried several combination of curl options and still get the pemission denied.
Can someone please provide an appropriate REST call format to register users on Anahita. We will appriecate it.
Thanks
Victor
Pavel Kulbakin
Victor Eberechi
Since REST registration API is stated as a feature of Anahita, I believe someone has registered a user via REST at least at testing level. Can someone please provide a sample code on how to register a user with the following information:
Name : foo_first foo_last
username : foo_username
email address: foo@foomail.com
password: foo_pass
I don't mind if the code is in AJAX or curl. This will save me the next 4 hours.
Thanks,
Victor.
Pavel Kulbakin
Umesh
curl "http://website.com/people/session" -H "Referer: http://website.com/people/session?return=aHR0cDovL2dlZXRtYW5qdXNoYS5jb20vaW5kZXgucGhw" --data "return=aHR0cDovL2dlZXRtYW5qdXNoYS5jb20vaW5kZXgucGhw&username=user&password=pwd&Submit=&format=json" -X POST
This doesnt respond anything except the next URL (with 303 code) which is http://website.com/index.php
cURL doesn't work (in context of Anahita) without Referer
Rajkumar Mundel
$http .post( "http://www.letsride.in/people/session.json?format=json", data, config) .success( function(data, status, headers, config){ $scope.message = "success"; }) .error(function(data, status, headers, config) { switch (status) { case 401: $scope.message = data.message; break; } });
But no success... any one can help on this... We are using angular JS
Pavel Kulbakin
Rajkumar Mundel
Pavel Kulbakin
Rajkumar Mundel
Pavel Kulbakin
Rajkumar Mundel
Chelladurai Pandian
Ngoc-Tung Nguyen
Rastin Mehr