-
Notifications
You must be signed in to change notification settings - Fork 1
API design
lilylei95 edited this page Apr 26, 2017
·
42 revisions
This document contains all proposed API features offered by the backend, and explanations of each feature.
Table of Contents
- Public
- Private
- Proposed HTTP methods: GET
- Body: None
- Function: Returns a JSON object containing a list of news objects to display on the home page
- Returns:
[ /*any # of:*/ { title: string, logo: string, text: string, author: string } ]
-
- Implemented
- Proposed HTTP methods: GET
- Body: None
- Function: Returns a JSON object containing info from conference table (name/location/time)
- Returns:
{ ConfName: string, StartDate: date, EndDate: date, Location: varchar }
- Implemented
- Proposed HTTP methods: GET
- Body: None
- Function: Returns a JSON object containing list of schedule event objects
- Returns:
[ /*any # of*/ { "start": string, "end": string, "name": string, "color": Object, "resizable": Object, "draggable": boolean }]
-
- Implemented
- Proposed HTTP methods: GET
- Body: None
- Function: Returns a JSON object containing list of exhibitors
- Returns:
{ exhibitors: [ /* TBD */ ] }
-
- Implemented
- Proposed HTTP Methods: POST
- Body:
{ Auth0Token, loginType: string, conference: string }
(Auth0Token Example) - Function: Checks if user has login privileges from appropriate table, creates user database entry if new, otherwise pulls metadata from database entry and returns token with metadata
- Returns:
{ user_data } | ErrorCode
-
- Implemented
- Proposed HTTP Methods: GET, PATCH
- Body(PATCH only):
{ in_user_data }
- Function:
-
PATCH: Modifies user database fields specified inside
in_user_data
- GET: Returns user data in json_format
-
PATCH: Modifies user database fields specified inside
- Returns:
{ user_data }
-
- Implemented
- Proposed HTTP Methods: GET
- Function:
- GET: Returns list of all exhibitor users for a conference
- Returns:
[ /* any # of: */ { email: string, name: string, company: string }]
-
- Implemented
- Proposed HTTP Methods: POST
- Body:
{ image: Object }
- Function: Uses the Imgur API to upload the posted image and return a link which is then used by the frontend / stored by the database. Note no database modification will be made in this route, it will only upload images to the Imgur API and return a link to the frontend
- Returns:
{ link: string }
-
- Implemented
- Proposed HTTP Methods: PATCH
- Body:
{ source: unique_id, fields: { /* fields to replace */ } }
- Function: Checks permissions of user source, and if allowed to update (is conference organizer) replace all columns appearing fields with new data supplied by post object
- Returns:
{ status: int }
-
- Implemented
- Proposed HTTP Methods: POST, DELETE
- Body:
{ source: unique_id, news_item: { title: string, text: string, logo: string, author: string } }
- Function: Checks permissions of user source, and if allowed to update (is conference organizer) add news_item as a new row in the news table
- Returns:
{ status: int }
-
- Implemented
- Proposed HTTP Methods: POST
- Body:
{ source: string, email: string }
- Function: Checks if source is allowed, then adds email and conference_id to permitted exhibitors table
- Returns:
[ /*any # of:*/ { title: string, logo: string, text: string, author: string } ]
-
- Implemented
- Proposed HTTP methods: PATCH
- Body:
[ */any # of*/ { "start": string, "end": string, "name": string, "color": Object, "resizable": Object, "draggable": boolean }]
- Function: Returns a JSON object containing list of schedule event objects
- Returns:
[ */any # of*/ { "start": string, "end": string, "name": string, "color": Object, "resizable": Object, "draggable": boolean }]
, or error -
- Implemented