-
Notifications
You must be signed in to change notification settings - Fork 1
API design
Grant Mercer edited this page Apr 19, 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 } ]
- 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 }
- TBD
- Proposed HTTP methods: GET
- Body: None
- Function: Returns a JSON object containing list of exhibitors
- Returns:
{ exhibitors: [ /* TBD */ ] }
- 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
- 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 }
- 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 }
- 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 }
- Proposed HTTP Methods: POST
- Body:
{ source: unique_id, news_item: { title: string, text: string, logo: 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 }
- Proposed HTTP Methods: POST
- Body:
{ source: unique_id, email: string }
- Function: Checks permission of user source, if allowed (is conference organizer) then adds email to permitted exhibitors
- Returns:
{ status: int }
- TBD