The PhaseII backend API, based on SQLAlchemy and Flask-restful.
Connect applications to the PhaseII Database using REST and JSON.
Currently used by the following PhaseII tools:
- PhaseWeb3: Vue based PhaseII Web UI
- BadManiac: Discord bot for scorecards and playvideos
This documentation is insanely out of date and needs work! Please read api/utils/main.py for endpoints.
Currently, application keys are not used. I plan on using them but for now it's not too important.
POST, DELETE, and UPDATE require a Session, which is encrypted by this API.
Anything Arcade, Admin, and User also require a Session.
Generarate a Session with POST /v1/auth/createSession, check a Session with /v1/auth/deleteSession, and delete a Session with /v1/auth/deleteSession.
All request paths start with /v1/ (minus the video sharing ones).
Status Codes (inside response):
success: OKwarn: Non-fatal warningserror: Fatal errors
All responses are in the format of {status: response status, error_code: if status is error or warn, data: response data}
GET- Returns a status message to confirm that the API is alive.
GET- Given an Arcade ID, return information about an arcade.
- Requires an active session and requires that you own the arcade.
GET- Given an Arcade ID, return an arcade's PASELI data.
- Requires an active session and requires that you own the arcade.
GET- Return all news data.
- No session required.
GET- Given a News ID, return all news data.
- No session required.
POST- Given a username, password and return an encrypted Session ID if credentials are correct.
POST- Given a Session ID and return its status.
POST- Given a Session ID and delete it. Always returns
success.
- Given a Session ID and delete it. Always returns
GET- Given a User ID and return a minified user profile.
- If a valid Session is sent to the server, and if the requested user is the Session's user, return more information about a user.
User.emailUser.data
GET- Returns the Session's user's saved cards.
- Requires a valid Session.
GET- Given a Game code and load all profiles.
GET- Given a Game and User ID and get user's profile for said game.
- Queries:
version: Version code for the profile. Defaults to the newest profile a user has.userId: Requird. The User ID for the profile.