Base URL:
https://foodtrucktrackrr.herokuapp.com/
[POST] /auth/diner/register
| name | type | required | description |
|---|---|---|---|
username |
String | Yes | Must be unique |
password |
String | Yes |
example:
{
username: "TestTom",
password: "pass123"
}
{
"message": "Diner Registration Successful.",
"id": 1,
"username": "TestTom",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMsInVzZXJuYW1lIjoiVGVzdFRvbSIsImlhdCI6MTU5MjUxMTEyNCwiZXhwIjoxNTkyNTE0NzI0fQ.0rp9BLFWDPpp8c03nD_soA1_TJNuTcS4rS6s8ZpsTsE"
}
[POST] /auth/diner/login
| name | type | required | description |
|---|---|---|---|
username |
String | Yes | Must exist in database |
password |
String | Yes | Must exist in database |
example:
{
username: "TestTom",
password: "pass123"
}
{
"message": "Welcome TestTom",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMsInVzZXJuYW1lIjoiVGVzdFRvbSIsImlhdCI6MTU5MjUxMTEyNCwiZXhwIjoxNTkyNTE0NzI0fQ.0rp9BLFWDPpp8c03nD_soA1_TJNuTcS4rS6s8ZpsTsE"
}
[POST] /auth/operator/register
| name | type | required | description |
|---|---|---|---|
username |
String | Yes | Must be unique |
password |
String | Yes |
example:
{
username: "TestTom",
password: "pass123"
}
{
"message": "Operator Registration Successful.",
"id": 1,
"username": "TestTom",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMsInVzZXJuYW1lIjoiVGVzdFRvbSIsImlhdCI6MTU5MjUxMTEyNCwiZXhwIjoxNTkyNTE0NzI0fQ.0rp9BLFWDPpp8c03nD_soA1_TJNuTcS4rS6s8ZpsTsE"
}
[POST] /auth/operator/login
| name | type | required | description |
|---|---|---|---|
username |
String | Yes | Must exist in database |
password |
String | Yes | Must exist in database |
example:
{
username: "TestTom",
password: "pass123"
}
{
"message": "Welcome TestTom",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMsInVzZXJuYW1lIjoiVGVzdFRvbSIsImlhdCI6MTU5MjUxMTEyNCwiZXhwIjoxNTkyNTE0NzI0fQ.0rp9BLFWDPpp8c03nD_soA1_TJNuTcS4rS6s8ZpsTsE"
}
[PUT] /operators/:id
| name | type | required | description |
|---|---|---|---|
id |
Integer | Yes | ID of logged in operator |
example:
{
"username": "ChangeTest",
"password": "passwerd"
}
{
"id": 1,
"username": "ChangeTest",
"password": "passwerd"
}
[DELETE] /operators/:id
| name | type | required | description |
|---|---|---|---|
id |
Integer | Yes | ID of logged in operator |
{
"Removed": 1
}
[POST] /operators/trucks
| name | type | required | description |
|---|---|---|---|
operator_id |
Integer | Yes | |
name |
String | Yes | |
image_URL |
String | No | |
cuisine_type |
String | Yes | |
customer_ratings_avg |
String | No | |
current_location |
String | No | |
open_time |
String | Yes |
example:
{
"operator_id": 1,
"name": "TEST2",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "TEST",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
}
{
"id": 4,
"operator_id": 1,
"name": "TEST2",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "TEST",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
}
[PUT] /operators/:id/trucks/:truck_id
| name | type | required | description |
|---|---|---|---|
id |
Integer | Yes | ID of logged in operator |
truck_id |
Integer | Yes | ID of specific truck |
| name | type | required | description |
|---|---|---|---|
name |
String | Yes | |
image_URL |
String | No | |
cuisine_type |
String | Yes | |
customer_ratings_avg |
String | No | |
current_location |
String | No | |
open_time |
String | Yes |
example:
{
"operator_id": 1,
"name": "Edit23",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "TEST",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
}
[DELETE] /operators/:id/trucks/:truck_id
| name | type | required | description |
|---|---|---|---|
id |
Integer | Yes | ID of logged in operator |
truck_id |
Integer | Yes | ID of specific truck |
{
"message": "Truck 4 deleted"
}
[GET] /operators/:id/trucks
{
"operator": {
"id": 1,
"username": "shotest",
"password": "$2a$08$.ksa8rFoNQ3ApY4Ggadfwenf/uddvvJJefvzVTJ.pOqdeAkeWd91u"
},
"truckOwned": [
{
"id": 2,
"operator_id": 1,
"name": "Tacos El Rey",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "Mexican",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
},
{
"id": 3,
"operator_id": 1,
"name": "TEST",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "Mexican",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
}
]
}
[GET] /operators/:id/trucks/:truck_id
| name | type | required | description |
|---|---|---|---|
id |
Integer | Yes | ID of logged in operator |
truck_id |
Integer | Yes | ID of specific truck |
{
"id": 2,
"operator_id": 1,
"name": "Tacos El Rey",
"image_URL": "https://s3-media0.fl.yelpcdn.com/bphoto/9vtpwRel1gua6nfwRghteg/l.jpg",
"cuisine_type": "Mexican",
"customer_ratings_avg": null,
"current_location": "4201 International Blvd, Oakland, CA 94601",
"open_time": "9:00AM"
}