HackGT / SponsorshipPortal

[in development] Web interface for sponsors to view participant information. Integrates with HackGT/registration
GNU General Public License v3.0
7 stars 0 forks source link

Proposed API (changes) #58

Open bunsenmcdubbs opened 6 years ago

bunsenmcdubbs commented 6 years ago

Routes

These routes include some changes from the original API plan but maintains the same functionality (and adds a bit more as well), just reorganized under more RESTful paths.

Routes

Route Method Description Request Response
/user PUT Create a new user {email: <string>, password: <string>, org_id: <id>} {token: <JWT>}
/user/login POST Login and authenticate {email: <string>, password: <string>} {token: <JWT>}
/user/{id}/state POST Save client state for the current user {state: <state obj>} {status: "ok"}
/user/{id}/state GET Get client state for the current user - {state: <state>}
/participant GET Get all participants - {participants: []<participant>}
/participant/search?q=<query> GET Search participants by keyword Search keywords in url query {participants: []<participant>}
/participant/flag PUT Flag participants for the current user {participant_ids: []<id>} {status: "ok"}
/participant/flag DELETE Unflag participants for the current user {participant_ids: []<id>} {status: "ok"}
/participant/flagged GET Get all flagged participants for the current user - {participants: []<participant>}
/participant/{id}/flag POST Flag participant for the current user None {status: "ok"}
/participant/{id}/flag DELETE Unflag participant for the current user None {status: "ok"}
/participant/{id}/resume GET Get url to view the participant's resume - {url: <url>}

Types

Name Type
JWT string
state stringified JSON
id integer
url string
participant { id: <id>, email: <string>, resume: <url>, flagged: <bool> }
bunsenmcdubbs commented 6 years ago

If/when this is approved, this document will get added to the repository (/api.md).

illegalprime commented 6 years ago

This saving / loading of the state is only for having only one user logged in at a time right?

bunsenmcdubbs commented 6 years ago

@illegalprime Yes you are correct, the issue has been edited to reflect this.