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
POST sign up
GET confirm login
PUT reset password
- 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
POST reguest password reset
GET confirm login
PUT reset password
Login
Logout
OAuth Link example
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
POST request change login
GET confirm login
(use pin from current login)
PUT chage login
GET confirm login
(use pin from new login)