Passenger API contains operations for passenger registration and data retrievals which is related to the passenger.
Registration
Mobile App
[website base address]/api/passenger/register.php
POST
| Member | Data Type | Comment |
|---|---|---|
| firstname | string | |
| lastname | string | |
| string | ||
| password | string | |
| address | string | |
| mobile | string | |
| panicmobile | string |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Registration Succesful |
POST [website base address]/api/passenger/register.php HTTP/1.1
Content-Type: application/json
{
"firstname": "Karlo EMil",
"lastname": "Flores",
"email":"keflores@up.edu.ph",
"password": "123",
"address": "Don Pablo Bldg, 114 Amorsolo Street, Legazpi Village, Makati, Kalakhang Maynila, Philippines",
"mobile": "09232341156",
"panicmobile": "093434554212",
"creditcardnumber": "124566",
"playerid":"123"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"message": "Passenger Successfully Registered.",
"id": 1
}
Update Passenger
Web Portal
Mobile App
[website base address]/api/passenger/update.php
POST
| Member | Data Type | Comment |
|---|---|---|
| firstname | string | |
| lastname | string | |
| string | ||
| password | string | |
| address | string | |
| mobile | string | |
| panicmobile | string |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Registration Succesful |
POST [website base address]/api/passenger/update.php HTTP/1.1
Content-Type: application/json
{
"firstname": "Karlo EMil",
"lastname": "Flores",
"email": "karloemilflores@gmail.com",
"password": "123456",
"address": "Don Pablo Bldg, 114 Amorsolo Street, Legazpi Village, Makati, Kalakhang Maynila, Philippines",
"mobile": "0912345677",
"creditcardnumber":"123456",
"panicmobile": "0912345677"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"message": "Passenger Successfully Updated.",
"id": 1
}
Delete Passenger
Web Portal
`[website base address]/api/passenger/delete.php
POST
| Member | Data Type | Comment |
|---|---|---|
| id | int |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Passenger's Account Removed |
POST [website base address]/api/passenger/delete.php HTTP/1.1
Content-Type: application/json
{
"id": 1
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"message": "Passenger Account Deleted",
"id": 1
}
Authenticate Passenger
Mobile App
`[website base address]/api/passenger/authenticate.php
POST
| Member | Data Type | Comment |
|---|---|---|
| string | optional field but return an empty string if no set email | |
| mobile | string | optional field but return an empty string if no set mobile |
| password | string |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Login Successfull |
POST [website base address]/api/passenger/authenticate.php HTTP/1.1
Content-Type: application/json
{
"email": "karloemilflores@gmail.com",
"mobile": "",
"password": "123456"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 200
{
"message": "Account is valid and existing",
"id": 1
}
Forgot Password
Mobile App
`[website base address]/api/passenger/forgotpass.php
POST
| Member | Data Type | Comment |
|---|---|---|
| string | Email of the account for the temporary email be sent |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Sent the temporary Password |
POST [website base address]/api/passenger/forgotpass.php HTTP/1.1
Content-Type: application/json
{
"email": "karloemilflores@gmail.com"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"message": "Sent temporary Password",
"id": 1
}
Activate Account
Web Portal
Mobile App
[website base address]/api/passenger/activateaccount.php
POST
| Member | Data Type | Comment |
|---|---|---|
| token | string | token should match the set token |
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | id of the activated account |
POST [website base address]/api/passenger/activateaccount.php HTTP/1.1
Content-Type: application/json
{
"token": "wafuwafuqh0e"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"message": "Activated the account",
"id": 1
}
Get Profile
Web Portal
Mobile App
[website base address]/api/passenger/get.php?id=1 or
[website base address]/api/passenger/get.php -> this will fetch all the passenger data in the database
GET
| Status | Description |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Sent the temporary Password |
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Mar 2018 09:00:57 +0000
Location: /api/passenger/get.php?id=1
Status: 201
{
"firstname": "Karlo Emil",
"lastname": "Flores",
"email": "karloemilflores@gmail.com",
"address": "North",
"mobile": "012323232",
"panicmobile": "012323232",
"password": "123456",
}
Set passenger's player id
Mobile App
[website base address]/api/passenger/setplayerid.php
POST
| Member | Data Type | Comment |
|---|---|---|
| id | numeric | |
| playerid | string |
| Status | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 405 | Method Not Allowed |
| 500 | Internal Server Error |
| Member | Data Type | Comment |
|---|---|---|
| message | string | |
| id | numeric | Present only if operation is successful |
POST [website base address]/api/passenger/setplayerid.php HTTP/1.1
Content-Type: application/json
{
"id": 1,
"playerid": "c0bb7827-6f61-46e9-ad53-28068fda6415"
}
Access-Control-Allow-Methods: POST
Access-Control-Allow-Orgin: *
Connection: close
Content-Type: application/json; charset=UTF-8
Date: Sat, 05 May 2018 08:19:02 +0000
Status: 200
{
"message": "Passenger Player ID set.",
"id": 1
}