Shivtr

Authentication

While you can perform some API actions as a guest, in many cases you will want to authenticate users.

Sign-in Object
{
"user": {
"email": "snafzg@email.com",
"password": "xyz789"
}
}


Logging In
To login a user send a POST request to the sign_in path.

Sample Curl Request
curl -H "Content-Type: application/json" \
http://your-site.shivtr.com/users/sign_in.json \
-d '{"user":{"email":"snafzg@email.com","password":"xyz789"}}'


Sample Response
{
"user": {
"id":8,
"name":"Snafzg",
"email":"snafzg@email.com",
"time_zone":"",
"authentication_token":"abcdef123456"
}
}


Upon a successful login, an authentication_token is returned, which can be used to make authenticated requests. For example, to request the list of videos as this user, you could do:

GET http://your-site.shivtr.com/videos.json?auth_token=abcdef123456

The authentication_token expires after 30 minutes of inactivity by the user, after which they will need to sign in again to get a new token.

Logging Out
To logout a user send a DELETE request to the sign_out path.

DELETE http://your-site.shivtr.com/users/sign_out.json?auth_token=abcdef123456