The Bus Route API Schema contains the bus unit routing information. In this module, it will let you:
Field | Type | Description |
---|---|---|
id
|
string | The unique bus route ID and the primary key. |
bus_id
|
string | The unique bus ID and the sort key. |
bus_unit_id
|
string | The bus unit ID for the identification of specific bus unit route. |
currency_code
|
string | The medium of exchange for goods and services (Currency Codes List). |
rate
|
number | The fare charged to the passenger. |
active
|
boolean | The availability of the bus unit for the defined route. |
departure_time
|
string | The expected departure time on the starting point and in 24-hour format (e.g. 15:00). |
arrival_time
|
string | The expected arrival time on the destination and in 24-hour format (e.g. 15:00). |
from_route
|
string | The starting point of a bus. |
to_route
|
string | The destination of a bus. |
date_created
|
string | The date that this bus unit record was created. |
Key | Value |
---|---|
Content-Type
|
application/json
|
Setting to application/json
is recommended.
Status Code | Description |
---|---|
200 | OK |
400 | Bad Request |
500 | Internal Server Error |
To create a new bus route instance, you need to instantiate an object that represents the bus route property. The bus route instance holds the information related to the specific bus unit route.
Method: POST
Endpoint: https://{api_id}.execute-api.{region}.amazonaws.com/prod/bus-route/create
Field | Type | Description | Required |
---|---|---|---|
bus_id
|
string | The unique bus ID. | ✅ |
bus_unit_id
|
string | The bus unit ID for the identification of specific bus unit route. | ✅ |
currency_code
|
string | The medium of exchange for goods and services (Currency Codes List). | ✅ |
rate
|
number | The fare charged to the passenger. | ✅ |
active
|
boolean | The availability of the bus unit for the defined route. | ✅ |
departure_time
|
string | The expected departure time on the starting point and in 24-hour format (e.g. 15:00). | ✅ |
arrival_time
|
string | The expected arrival time on the destination and in 24-hour format (e.g. 15:00). | ✅ |
from_route
|
string | The starting point of a bus. | ✅ |
to_route
|
string | The destination of a bus. | ✅ |
{
"rate": 120,
"active": true,
"currency_code": "PHP",
"bus_id": "SNRSBSS-875011",
"bus_unit_id": "SNRSBSSBUS002",
"departure_time": "15:00",
"arrival_time": "17:00",
"from_route": "Route A",
"to_route": "Route B"
}
When retrieving the specific bus route information, the id
and bus_id
query parameters must be present in the URL. These parameters identify which information should be returned. It will either return a representation of a specific bus route information or a list of bus route information.
Method: GET
Endpoint: https://{api_id}.execute-api.{region}.amazonaws.com/prod/bus-route/get
Query Parameters
Parameter | Type | Description | Required |
---|---|---|---|
id
|
string | The unique bus route ID. | ✅ |
bus_id
|
string | The unique bus ID. | ✅ |
[
{
"rate": 120,
"active": true,
"currency_code": "PHP",
"id": "RTRTC15001900877753",
"bus_id": "SNRSBSS-875011",
"bus_unit_id": "SNRSBSSBUS002",
"departure_time": "15:00",
"arrival_time": "17:00",
"from_route": "Route A",
"to_route": "Route B"
}
]
When retrieving a list of bus route records, the bus_id
query parameter must be present in the URL, and either of the active
, bus_unit_id
, departure_time
, arrival_time
, from_route
, or to_route
is optional in the query parameter. These parameters will identify which bus route record(s) should be returned.
Method: GET
Endpoint: https://{api_id}.execute-api.{region}.amazonaws.com/prod/bus-route/search?bus_id=xxxxxx
Parameter | Type | Description | Required |
---|---|---|---|
bus_id
|
string | The unique bus ID. | ✅ |
bus_unit_id
|
string | The bus unit ID for the identification of specific bus unit route. | ❌ |
active
|
boolean | The availability of the bus unit for the defined route. | ❌ |
departure_time
|
string | The expected departure time on the starting point and in 24-hour format (e.g. 15:00). | ❌ |
arrival_time
|
string | The expected arrival time on the destination and in 24-hour format (e.g. 15:00). | ❌ |
from_route
|
string | The starting point of a bus. | ❌ |
to_route
|
string | The destination of a bus. | ❌ |
[
{
"id": "RTBRTC15001900880102",
"bus_id": "SNRSBSS-875011",
"bus_unit_id": "SNRSBSSBUS002",
"currency_code": "PHP",
"rate": 90,
"active": true,
"departure_time": "15:00",
"arrival_time": "19:00",
"from_route": "Route B",
"to_route": "Route C",
"date_created": "1688010233"
},
{
"id": "RTRTB15001900880101",
"bus_id": "SNRSBSS-875011",
"bus_unit_id": "SNRSBSSBUS002",
"currency_code": "PHP",
"rate": 90,
"active": true,
"departure_time": "15:00",
"arrival_time": "19:00",
"from_route": "Route A",
"to_route": "Route B",
"date_created": "1688010114"
}
]
When modifying the bus route record, the id
and bus_id
query parameters must be present in the URL. These parameters identify which bus route record should be modified. After the update is performed, it will return a representation of the updated bus route record.
Method: POST
Endpoint: https://{api_id}.execute-api.{region}.amazonaws.com/prod/bus-route/update?id=xxxxx&bus_id=xxxxx
Parameter | Type | Description | Required |
---|---|---|---|
id
|
string | The unique bus route ID. | ✅ |
bus_id
|
string | The unique bus ID. | ✅ |
Parameter | Type | Description | Required |
---|---|---|---|
currency_code
|
string | The medium of exchange for goods and services (Currency Codes List). | ❌ |
rate
|
number | The fare charged to the passenger. | ❌ |
active
|
boolean | The availability of the bus unit for the defined route. | ❌ |
departure_time
|
string | The expected departure time on the starting point and in 24-hour format (e.g. 15:00). | ❌ |
arrival_time
|
string | The expected arrival time on the destination and in 24-hour format (e.g. 15:00). | ❌ |
from_route
|
string | The starting point of a bus. | ❌ |
to_route
|
string | The destination of a bus. | ❌ |
Payload:
{
"active": false
}
Response:
{
"id": "RTRTB15001900880101",
"bus_id": "SNRSBSS-875011",
"bus_unit_id": "SNRSBSSBUS002",
"currency_code": "PHP",
"rate": 90,
"active": false,
"departure_time": "15:00",
"arrival_time": "19:00",
"from_route": "Route A",
"to_route": "Route B",
"date_created": "1688010114"
}