Skip to content

Mobile APIs

Tao Peter Wang edited this page Oct 2, 2016 · 3 revisions

/login

  • Validates and logs user in
  • Method: POST
  • Parameters (x-www-form-urlencoded):
    • email: user email
    • password: user password (encoded)
  • Response:
    • error - String: error if any
    • user
      • email - String: user email
      • verified - boolean: whether the user has verified his/her email

/register

  • Registers user
  • Method: POST
  • Parameters (x-www-form-urlencoded):
    • email: user email
    • password: user password (encoded)
  • Response:
    • error - String: error if any
    • user
      • email - String: user email
      • verified - boolean: whether the user has verified his/her email

/sync

  • Synchronize local user with server
  • Method: GET
  • Parameters:
    • email: user email
    • password: user password (encoded)
  • Response:
    • error - String (optional): error if any
    • email - String: user email
    • verified - boolean: whether user is verified

/changepwd

  • Change password
  • Method: POST
  • Parameters (x-www-form-urlencoded):
    • email: user email
    • oldPassword: old password
    • newPassword: new password
  • Response:
    • error - String: error if any, null means change password success

/send

  • Tell server to re-send verification email
  • Method: GET
  • Parameters (x-www-form-urlencoded):
    • email: user email
    • password: user password (encoded)
  • Response:
    • error: error if any, null means send success

/stops

  • Synchronize local version of stops with server's
  • Method: GET
  • Parameters:
    • lastUpdated: last updated time in milliseconds
  • Response:
    • [{ name: $stopName, stopId: $stopID }, ...]

/request

  • Make request for pick up
  • Method: POST
  • Parameters:
    • email: user email
    • password: user password (encoded)
    • stopId: MongoDB formatted objectId for the stop requested
  • Response:
    • error - String: error if any, null means request success

/cancel

  • Cancel pending request
  • Method: POST
  • Parameters:
    • email: user email
    • password: user password (encoded)
    • stopId: MongoDB formatted objectId for the stop of the cancelled request
  • Response:
    • error - String: error if any, null means cancel success

Clone this wiki locally