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:


Users

Endpoints for the Users resource:

Log In

Logs in an existing user POST api/users/login

Body Parameters

Parameter Type Description Notes
email string email of the user logging in required
password string password of the user logging in required

Returns

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)

Sign Up

Registers use in database POST api/users/signup

Body Parameters

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

Returns

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.

Logout

Logs user out from session POST api/users/logout

Body Parameters

No Required Parameters

Returns

Logs user out by deleting the auth token from the session cookie. Redirects user to / front end route.


Shows

Endpoints for the Shows resource:


Booths

Endpoints for the Booths resource:


Objects

User Object

{
  "hashedId": "3gS1fXXFp1",
  "firstName": "Derrick",
  "lastName": "Davis",
  "email": "[email protected]",
  "company": "Facebook Video Analytics",
  "job": "External Partnership Manager",
  "card": {BusinessCardJSONObject}
}

Show Object

{
  "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"
}

Booth Object

{
  "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}
}
⚠️ **GitHub.com Fallback** ⚠️