Skip to content

Administrators

Admin Login

POST /api.php

This endpoint is used for administrator authentication. It validates the provided credentials and, if successful, initiates a new admin session.

Request Body Parameters:

ParameterDescriptionRequired?
CommandAdmin.LoginYes
UsernameThe username of the admin attempting to log inYes
PasswordThe password for the admin accountYes
CaptchaThe captcha code to verify if captcha is enabledConditional
DisableCaptchaSet to true to disable captcha verificationNo
AdminApiKeyThe API key for admin verificationNo
Disable2FASet to true to disable two-factor authenticationNo
TfaCodeThe two-factor authentication codeConditional
bash
curl -X POST https://example.com/api.php \
  -d 'Command=Admin.Login' \
  -d 'Username=admin' \
  -d 'Password=123456'
json
{
  "Success": true,
  "ErrorCode": 0,
  "SessionID": "newSessionId",
  "AdminInfo": {
    "AdminID": "1",
    "Username": "admin"
  }
}
json
{
  "Success": false,
  "ErrorCode": [
    3
  ]
}
txt
1: Missing username
2: Missing password
3: Invalid username or password
4: Missing captcha
5: Invalid captcha
101: Invalid two-factor authentication code

Update Administrator Details

POST /api.php

This endpoint allows for updating the details of an existing administrator account. It requires the admin to be authenticated and to own the account that is being updated.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandAdmin.UpdateYes
AdminIDThe unique identifier for the admin accountYes
NameThe full name of the adminYes
UsernameThe username for the admin accountYes
EmailAddressThe email address associated with the admin accountYes
PasswordThe new password for the admin account (optional)No
bash
curl -X POST https://example.com/api.php \
  -d 'SessionID=exampleSessionId' \
  -d 'APIKey=exampleApiKey' \
  -d 'Command=Admin.Update' \
  -d 'AdminID=1' \
  -d 'Name=John Doe' \
  -d 'Username=johndoe' \
  -d 'EmailAddress=john.doe@example.com' \
  -d 'Password=newpassword123'
json
{
  "Success": true,
  "ErrorCode": 0
}
json
{
  "Success": false,
  "ErrorCode": [
    7
  ]
}
txt
1: Missing name
2: Missing username
4: Missing email address
6: Invalid admin ID
7: Invalid email address format
8: Admin account not owned by the logged-in admin

Any questions? Contact us.