Skip to content
Nikola Begedin edited this page Nov 17, 2015 · 9 revisions

POST /oauth/tokens

Used to log in as a regular or facebook user

Logging in as regular user

// request format 
// application/x-www-form-urlencoded; charset=utf-8

grant_type: 'password'
username: <user_email>,
password: <user_password>
// response format
{
  access_token: <token_string>,
  expires_in: <time_in_seconds>,
  token_type: 'bearer',
  user_id: <user_id>,
  created_at: <time_of_creation_as_integer>
}

Logging in as facebook user

  • The request format is the same, except the username needs to be set to 'facebook', and the password is actually the Facebook access token retrieved by using whichever Facebook SDK or API the client uses.
// request format
{
  username: 'facebook',
  password: <facebook_access_token>
}
// response format
{
  access_token: <token_string>,
  expires_in: <time_in_seconds>,
  token_type: 'bearer',
  user_id: <user_id>
}
Clone this wiki locally