API Documentation - sjstark/booth-it GitHub Wiki
The Booth It API is organized around REST. Our API has predictable resource oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and verbs.
API routes are not user-facing and should only be used by developers.
All API routes are to be prefixed with /api
for distinction and clarity.
Resources:
Endpoints for the Users
resource:
Logs in an existing user
POST api/users/login
Parameter | Type | Description | Notes |
---|---|---|---|
email |
string |
email of the user logging in |
required |
password |
string |
password of the user logging in |
required |
Upon success, logs in current user and responds with session id information. Upon failure, sends JSON error message (redacts parts of entry that are incorrect)
Registers use in database
POST api/users/signup
Parameter | Type | Description | Notes |
---|---|---|---|
firstName |
string |
firstName of the user logging in |
required |
lastName |
string |
lastName of the user logging in |
required |
email |
string |
email of the user logging in |
required |
password |
string |
password of the user logging in |
required |
company |
string |
company of the user logging in |
required |
jobTitle |
string |
jobTitle of the user logging in |
required |
profilePic |
image buffer |
profilePic of the user logging in |
Upon success, registers current user and creates a database entry for user with information and hashedPassword
. Responds with new User
object. On failure, it responds with JSON response of incorrect or required fields.
Logs user out from session
POST api/users/logout
No Required Parameters
Logs user out by deleting the auth token from the session cookie. Redirects user to /
front end route.
Endpoints for the Shows
resource:
- Get All -
GET /shows
- Get All Owned Shows -
GET /my-shows
- Create New -
POST /shows
- Get Show by ID -
GET /shows/<hashedId>
- Fully Update Show -
PUT /shows/<hashedId>
- Update Part of Show -
PATCH /shows/<hashedId>
- Delete a Show -
DELETE /shows/<hashedId>
- Add a Partner -
POST /shows/<hashedId>/partners
- Remove a Partner -
DELETE /shows/<hashedId>/partners/<partnerId>
- Search -
GET /shows/search?includes={}&excludes={}
Endpoints for the Booths
resource:
- Get All -
GET /show/<hashedId>/booths
- Create New -
POST /booths
- Get Booth by ID -
GET /booths/<hashedId>
- Fully Update Booth -
PUT /booths/<hashedId>
- Update Part of Booth -
PATCH /booths/<hashedId>
- Delete a Booth -
DELETE /booths/<hashedId>
- Search -
GET /booths/search?includes={}&excludes={}
{
"hashedId": "3gS1fXXFp1",
"firstName": "Derrick",
"lastName": "Davis",
"email": "[email protected]",
"company": "Facebook Video Analytics",
"job": "External Partnership Manager",
"card": {BusinessCardJSONObject}
}
{
"hashedId": "3gS1fXXFp1",
"title": "International Broadcaster's Convention",
"description": "IBC is the largest convention in the world for the film and media industry.",
"dates": ["12-21-2020", "12-22-2020", "12-24-2020"],
"primaryColor": "#23A3B3",
"secondaryColor": "#A333F3"
}
{
"hashedId": "xIgNxplT6b",
"hashedShowId": "3gS1fXXFp1",
"company": "Facebook",
"description": "Facebook's video and marketting services can help serve metrics and analytics for your next project!",
"primaryColor": "#4267B2",
"secondaryColor": "#898F9C",
"size": "Large",
"profile": {ProfilePageJSONObject}
}