WheyPI v0.1
This is the WheyPI (pronounced "Way-pee-I", get it?) which is a shitty tracker and aggregator for lifting and general exercise faffery.
Submissions are authenticated with a pre-shared salt. Simply attach an auth header to your HTTP request like so:
... Authorization: FuckYou <salt goes here> ...
The FuckYou
is required. It's my API and I'll do what I want.
All responses are of the following form:
{"success":true,"error":"","data":{}}
success
will either be true
or false
, and error
will hopefully contain a useful error message about what went wrong.
* POST /api/lifts - Submit a new lift * GET /api/lifts - Get all lifts, by time. * GET /api/lifts/{nickname} - Get lifts for a user by nickname, ordered by time.
* GET /api/users/{nickname} - Get user details by nickname.
/api/lifts
POST
Submits a new lift. If a user with the given nickname has not been seen before, they will be created.
Submission Data
{ "nickname"*: "qpfiffer", "sets"*: 5, "weight"*: 135, "reps"*: 8, "lift"*: "squats", "created_at": "2021-01-01T16:12:56.218Z" }
* denotes required.
↵
{"success":true,"error":"","data":{}}
GET
Lists lifts, ordered by time.
↵
{"success":true, "error":"", "data":[ { "id":"5d6514a1-7163-446e-a8cb-d7ef93b8c5bc", "user_id":"52b5cb8b-32d3-4f99-95c3-8604852d60ad", "lift":"benchpress", "weight":135, "sets":5, "reps":5, "created_at":"2021-01-22 13:56:23.401862-07", "updated_at":"" }, ... ]}
/api/lifts/{nickname}
GET
Gets lifts for a given user by nickname.
↵
{"success":true, "error":"", "data":[ { "id":"5d6514a1-7163-446e-a8cb-d7ef93b8c5bc", "user_id":"52b5cb8b-32d3-4f99-95c3-8604852d60ad", "lift":"benchpress", "weight":135, "sets":5, "reps":5, "created_at":"2021-01-22 13:56:23.401862-07", "updated_at":"" }, ... ]}
/api/users/{nickname}
GET
Gets information for a user by nickname.
↵
{"success":true,"error":"","data":{ "id":"52b5cb8b-32d3-4f99-95c3-8604852d60ad", "nickname":"qpfiffer", "created_at":"2021-01-22 13:56:23.401862-07", "updated_at":"" }}
Source code. © Copyright 2021, El Presidente