Skip to content

Latest commit

 

History

History
124 lines (99 loc) · 3.65 KB

auth.md

File metadata and controls

124 lines (99 loc) · 3.65 KB

Auth API Documentation

POST Get Key

Getting key to access another API with icon 🔒. First step to access our system with API.

Resource URL

/api/v2/auth/login

Parameters
  • email required with password. Valid email address
  • password required with email. User password.
  • fb_token required with fb_uid. Facebook token from Facebook Connect.
  • fb_uid required with fb_token. Facebook UID from Facebook Connect. Used for checking existing user.
  • gcm_id optional Google Cloud Message ID. For notification.

You can use with either email and password, or fb_token and fb_uid.

Sample Request
curl -X POST --data "[email protected]&password=rahasia" http://shoop.dev/api/v2/auth/login
Sample Response
{
    "status": 1,
    "key": "4974328ce522a3eb86ecf73a193490314cf98c74"
}
Sample Error

Missing parameter.

{
    "status": 0,
    "error": "Your parameter is not complete. Missing parameter 'password'."
}

Password invalid.

{
    "status": 0,
    "error": "Your password is invalid."
}

POST Register

Register to Shoop system. If you connect with facebook please add fb_token.

Resource URL

/api/v2/auth/register

Parameters
  • email required Valid email address.
  • password required User password.
  • name required User name.
  • id_location required Location ID, you can get it from Location.
  • phone optional User phone.
  • gcm_id optional Google Cloud Message ID. For notification.
  • longitude optional Location user by Longitude.
  • latitude optional Location user by Latitude.
  • avatar optional Path for user avatar
  • fb_token optional Facebook Access Token from Facebook Connect.
  • show_phone deprecated
  • address deprecated
Sample Request
curl -X POST --data "[email protected]&password=rahasia&name=shcode&id_location=7&phone=082232856363" http://shoop.dev/api/v2/auth/register
Sample Response
{
    "status": 1,
    "key": "4974328ce522a3eb86ecf73a193490314cf98c74"
}

POST Forgot Password

Request token to reset password and then send to email.

Resource URL

/api/v2/auth/forgot_password

Parameters
  • email required Valid email address.
Sample Request
curl -X POST --data "[email protected]" http://shoop.dev/api/v2/auth/forgot_password
Sample Response
{
    "status": 1,
    "message":"Profile detail and reset password has been sent to your email."
}