Client API
One endpoint, /api/1.0. Send parameters as form data, JSON, or query string with GET or POST. Pick the action with the type parameter. Every response is JSON with success and message.
Flow
- 01
Call
initwith your app name, owner ID and version to get a session ID. - 02
Call
login,registerorlicensewith that session. - 03
Use the session for variables, logs and checks.
Request types
type=initname, ownerid, ver
Starts a session (valid 1 hour). Returns sessionid. If ver differs from the app version, returns success=false with a download link.
type=registersessionid, username, pass, key, hwid
Creates a user by redeeming an unused license key. Duration and level come from the key.
type=loginsessionid, username, pass, hwid
Logs a user in. Checks ban, expiry, blacklist and HWID lock.
type=licensesessionid, key, hwid
License-only login. First use redeems the key and creates a user named after the key.
type=upgradesessionid, username, key
Redeems another key to extend an existing user. Level becomes the higher of the two.
type=varsessionid, varid
Returns a server variable in message. Auth-only variables require a logged-in session.
type=logsessionid, message, pcuser
Writes a custom log line to your dashboard.
type=checksessionid
success=true when the session has a logged-in user.
type=bansessionid, hwid, reason
Bans the logged-in user and blacklists their HWID. Use when your app detects tampering.
type=fetchStatssessionid
Returns total users, users online in the last hour, and current version.
type=logoutsessionid
Ends the session.
Verifying responses
Responses for a known app include a signature header: HMAC-SHA256 of the raw response body, keyed with your app's secret. Recompute it on the client and reject mismatches to block fake auth servers.
import hmac, hashlib
expected = hmac.new(SECRET.encode(), res.content, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, res.headers["signature"]):
raise SystemExit("Response was tampered with")