Users: [
{
"id": 1,
"username": "admin",
"password": "password"
"name": "Leonel, Gabriel, and Mateo",
"about": "We are a team of drone hobbyists.",
"projects": [
{
"id": 1,
"projectName": "Drone Fanatics",
"projectType": "Robotics",
"description": "We would like to expand our photography drone creation and repair hobby into a business.",
"fundingAmount": 5000.00,
"user_id": 1,
}
]
},
{
"id": 2,
"username": "admin2",
"password": "password",
"name": "Jayla",
"about": "I created a small 3D printing business.",
"projects": [
{
"id": 2,
"projectName": "Jayla's Trinkets",
"projectType": "3D Printing",
"description": "I currently run my business with one 3D printer. I would like to expand to four printers so I can increase my productivity and sales.",
"fundingAmount": 15000.00,
"user_id": 2,
},
]
},
{
"id": 3,
"username": "admin3",
"password": "password",
"name": "Aaliyah and Trinity",
"about": "We are working to create drought resistance crops.",
"projects": [
{
"id": 3,
"projectName": "Genexis Lab",
"projectType": "Biotechnology",
"description": "We currently have a small lab where we are working on creating drought resistant crops. We are in need of some new equipment and supplies.",
"fundingAmount": 10000.00,
"user_id": 3,
},
]
}
]
Table | Method | Endpoint | Description |
---|---|---|---|
users | POST | /auth/register | Registers a new user. |
users | POST | /auth/login | Logs in already registered user. |
Method URL: /auth/register
HTTP Method: [POST]
Name | Type | Required | Description |
---|---|---|---|
username |
String | Yes | Must be unique. |
password |
String | Yes | |
email |
String | No |
{
"username": "superchef",
"password": "ilovefood",
"email": "[email protected]"
}
If you successfully register a user, the endpoint will return an HTTP response with a status code
201
.
If you are missing a username or password, the endpoint will return an HTTP response with a status code of
400
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /auth/login
HTTP Method: [POST]
Name | Type | Description |
---|---|---|
username |
String | Must match username in database. |
password |
String | Must match password to corresponding username in database. |
{
"username": "vrproject",
"password": "ilovemoney"
}
{ "name": "John", "about": "Tech developer" }
If you successfully log in, the endpoint will return an HTTP response with a status code
200
.
If you are missing a username or a password, the endpoint will return an HTTP response with a status code of
400
.
If you provide invalid credentials, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /users/
HTTP Method: [GET]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
If users are found, the endpoint will return an HTTP response with a status code
200
.
If users are not found, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /users/:id
HTTP Method: [GET]
If user with specified ID is found, the endpoint will return an HTTP response with a status code
200
.
If user with specified ID is not found, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /users/:id/projects
HTTP Method: [GET]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
If user with specified ID is found, the endpoint will return an HTTP response with a status code
200
.
If user with specified ID is not found, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /users/:id
HTTP Method: [DELETE]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
If user with specified ID is found and deleted, the endpoint will return an HTTP response with a status code
200
.
If user with specified ID is not found, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /users/:id
HTTP Method: [PUT]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
Name | Type | Required | Description |
---|---|---|---|
username |
String | Yes | Must be unique. |
password |
String | Yes | |
name |
String | Yes | |
about |
Text | Yes |
{
"username": "vrproject",
"password": "ilovemoney",
"name": "John",
"about": "Tech developer"
}
If user with specified ID is found and updated, the endpoint will return an HTTP response with a status code
200
.
If user with specified ID is not found, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /projects
HTTP Method: [POST]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
Name | Type | Required | Description |
---|---|---|---|
projectName |
String | Yes | |
projectType |
String | Yes | |
description |
String | Yes | |
fundingAmount |
Decimal | Yes | |
user_id |
Integer | Yes |
{
"projectName": "Test project 1",
"projectType": "Tech",
"description": "Small tech business test project 1",
"fundingAmount": 5000.00,
"user_id": 1,
}
If project is created, the endpoint will return an HTTP response with a status code
201
.
If you are missing any project information, the endpoint will return an HTTP response with a status code of
400
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /projects
HTTP Method: [GET]
No headers needed. /projects
is not a protected path.
If projects are found, the endpoint will return an HTTP response with a status code
200
.
If projects are not found, the endpoint will return an HTTP response with a status code
404
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /projects/:id
HTTP Method: [GET]
No headers needed. /projects/:id
is not a protected path.
If project with specified ID is found, the endpoint will return an HTTP response with a status code
200
.
If project with specified ID is not found, the endpoint will return an HTTP response with a status code
404
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /projects/:id
HTTP Method: [PUT]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
Name | Type | Required | Description |
---|---|---|---|
projectName |
String | Yes | |
projectType |
String | Yes | |
description |
String | Yes | |
fundingAmount |
Decimal | Yes | |
user_id |
Integer | Yes |
{
"projectName": "Test project 1",
"projectType": "Tech",
"description": "Small tech business test project 1",
"fundingAmount": 5000.00,
"user_id": 1,
}
If project with specified ID is found and updated, the endpoint will return an HTTP response with a status code
200
.
If project with specified ID is not found and updated, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.
Method URL: /projects/:id
HTTP Method: [DELETE]
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/JSON |
Authorization |
String | Yes | JSON Web Token |
If project with specified ID is found and deleted, the endpoint will return an HTTP response with a status code
200
.
If project with specified ID is not found and deleted, the endpoint will return an HTTP response with a status code
404
.
If user does not have access, the endpoint will return an HTTP response with a status code of
401
.
If there is a server or database error, the endpoint will return an HTTP response with a status code of
500
.