Response codes
{
"status": boolean, (true if request was processed successfully, false if any error happened)
"status-text": string, (human-readable message of what did just happen)
"code": string (short text that lets you manage api response in your software more easily)
}
This file is a list of possible "code" responses and explanations of what they mean.
-
- method-not-accepted - HTTP error, API accepts only GET, POST, PUT and DELETE requests.
- not-enough-parameters - this one's self-explainatory, similar to previous one. required parameters are not present in the request.
- sql-injection-attempt - blocked SQL injection attack
- db-error - unexpected database error
- no-permissions - not enough permission with this authcode
-
- user-id-required - "id" variable not found in GET request.
- user-id-not-a-number - "id" variable has to be numeric
- user-not-exist - requested user does not exist in the database
- user-data-success - user has been found and its data is in "user-data" variable
- user-username-long - given username is too long (more than 20 characters)
- user-username-short - given username is too short (less than 4 characters)
- user-email-incorrect - given e-mail address is not correct
- user-email-long - given e-mail address is too long (more than 40 characters)
- user-email-short - given e-mail address is too short (less than 4 characters)
- user-password-long - given password is too long (more than 64 characters)
- user-password-short - given password is too weak (less than 6 characters)
- user-already-exist - user with given username already exist
- user-registered - user has been created without any issue
- user-wrong-credentials - given login credentials are not valid
- user-valid-credentials - given login credentails are valid
- user-removed - user with given ID has been removed
- user-nothing-to-change - no changes has been requested
- user-updated - user information has been updated
- user-totp-valid - given 2FA totp code is valid
- user-totp-wrong - given 2FA totp code is not valid
-
- invite-success - request processed successfully
- invite-no-id - user's "id" not specified in request
- invite-args-missing - missing either or all "code" and "user_id" in request
- invite-code-invalid - given incorrect invite code
- invite-in-use - given invite code is already in use
-
- song-success - request processed successfully
- song-not-found - song does not exist in the database
- song-icecast-error - could not connect and/or retrieve data from Icecast
- song-incorrect-parameter - cannot find a song using this parameter
- song-incorrect-length - song title has invalid length
- album-incorrect-length - album name has invalid length
- song-id-not-a-number - "song_id" variable has to be numeric
-
- like-success - request processed successfully
- like-invalid-parameters - missing or incorrect request parameter combination
- like-id-not-numeric - either or all "user_id", "song_id" and "status" are not numeric
- like-song-not-liked - song is not liked yet by the specified user