Driven People API v1

Description

Ultimate solution for drivers and oparators colaboration.

Authentication

We use JWT to authenticate requests. Sign up, confirm login, sign in (get JWT) and you are welcome to make any request.

Registration Flow

  1. POST sign up
  2. GET confirm login
  3. PUT reset password
  4. Complete registration:
    • POST create company (As an Operator)
    • POST create profile (As a Driver)

If you didn’t recieve confirmation code, you can request it again by POST confirmation. If you confirmed login but didn’t set password, you can request password reset by POST password.

Reset Password Flow

  1. POST reguest password reset
  2. GET confirm login
  3. PUT reset password

Login

  • POST sign in

Logout

  • DELETE sign out
Google ```javascript var authorizationUrl = 'https://accounts.google.com/o/oauth2/v2/auth'; authorizationUrl += '?response_type=code'; authorizationUrl += '&client_id=YOUR_CLIENT_ID'; authorizationUrl += '&redirect_uri=YOUR_DOMAIN/api/v1/users/auth/google_oauth2/callback'; authorizationUrl += '&scope=https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email'; var role = 'operator'; // Change this value as per your requirement authorizationUrl += '&state=' + encodeURIComponent(JSON.stringify({role: role})); ```
Facebook ```javascript var authorizationUrl = 'https://www.facebook.com/v19.0/dialog/oauth'; authorizationUrl += '?response_type=code'; authorizationUrl += '&client_id=YOUR_CLIENT_ID'; authorizationUrl += '&redirect_uri=YOUR_DOMAIN/api/v1/users/auth/facebook/callback'; authorizationUrl += '&scope=email,public_profile'; var role = 'driver'; // Change this value as per your requirement authorizationUrl += '&state=' + encodeURIComponent(JSON.stringify({role: role})); ```

Change login flow

  1. POST request change login
  2. GET confirm login (use pin from current login)
  3. PUT chage login
  4. GET confirm login (use pin from new login)