Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed API (changes) #58

Open
bunsenmcdubbs opened this issue Feb 23, 2018 · 3 comments
Open

Proposed API (changes) #58

bunsenmcdubbs opened this issue Feb 23, 2018 · 3 comments

Comments

@bunsenmcdubbs
Copy link
Contributor

bunsenmcdubbs commented Feb 23, 2018

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
Copy link
Contributor Author

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

@illegalprime
Copy link
Member

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

@bunsenmcdubbs
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants