markusmaal.ee API

login
logout
mysql_query
doc

Endpoint: https://markusmaal.ee/api/

/login

Note: login doesn't work if user is not verified with verification code

Method: POST

Input: Basic authorization (Username/Password)

Output:

  • 200 - login successful (empty output)/already logged in (outputs JSON with "message")
  • 403 - login failed (outputs JSON with "message")

/logout

Method: <any>

Input: <none>

Output:

  • 200 - logout successful (empty output)
  • 400 - error occurred (outputs JSON with "message")

/mysql_query

Note: mysql_query doesn't work unless SESSION cookie is set with /login

Method: POST

Input:

  • Format: JSON
  • Args: table (type: string)

Output:

  • 200 - query successful (outputs JSON with all table data)
  • 400 - missing arguments (outputs JSON with "message")
  • 401 - not logged in (outputs JSON with "message")

/doc

Method: GET

Input:

  • Format: JSON
  • Args: type (type: enum ["doc", "widget"]), name (type: string), lang (type: enum ["en", "et"])

Optional input (widget args):

  • Format: URL params
  • Args: a (type: string), b (type: string), c (type: string)

Output:

  • 200 - document found, returns the following data as JSON:
    • title
    • category
    • tags (comma separated)
    • content (as HTML)
  • 400 - missing or invalid arguments (outputs JSON with "message")
  • 404 - document not found (outputs JSON with "message")