The API requires a license.
Version 1.85 renamed the api page to api.ashx.
You may also rename or remove this file if you don't need its functionality.
API Format
To utilize the API, simply make a web request to the api.ashx page (or use uget tool--see below) with the following parameters:
http://somesite.com/api.ashx?u=username&p=password&i=id&c=somecmd
Option | Desc |
u= | A user name (some commands require an admin account) |
p= | Password for user |
c= | The command (see below command list table |
i= | ID # to perform the command on (typically a server or user ID #) |
o1, o2, o3 | Some API commands take additional options, these are specified using the 'o' options |
Implemented commands
Command | Description | Notes |
alive | Always returns true | Useful to see if the panel is up |
running | Returns true if running, otherwise false | i= specifies id of server to check |
panelstats | Returns status of total running servers, total setup servers, total active players connected to all servers, and total max players supported by all servers. | Similar to information shown at the top of the main server list menu. |
status | Returns status of a server. | Possible return values are 'Running', 'Updating', 'Stopped' |
statusall | Returns a list of servers with their status. Output is similar to listservers2, but includes status. | Possible return values for status are 0=stopped, 1=running, 2=updating, 3=pending udpate (graceful shutdown is in progress, then will be updated), 4=pending_restart,5=pending_stop, 6=remote_error, 7=remote_offile, 8=installing |
query | Returns query info of server | List format is title, map, players |
start | Start a server | i= specifies id of server to start |
stop | Stop a server | i= specifies id of server to stop |
pid | Returns the PID value of server's process | Returns 0 if not running. |
update | Initiate an update for a server | Use the status command to monitor for when the update is finished. |
hashes | Update hashes for a server | If using hashes the API will update hashes set for server. |
restart | Restart a server | i= specifies id of server to restart |
restartempty | Restart a server when the amount of players falls below the min player count setting | |
disables | Disable a server | o1 allows passing a reason/comment to the panel. Passing o2=1 will disable the owner's account if it's the last active server on their account. |
deletes | Delete server from the panel | Does not delete server files, simply removes the server's entry from the database. |
deletesf | Delete server and its files | Remove from database and delete files (delete from server's root or server working directory) |
enables | Enable a server | |
disableu | Disable a user's account | |
enableu | Enable a user's account | |
extra | Run the specified extra | i= the ID of the extra deifnition |
newuser | Create a new user. o1=account name, 02=email address | Returns a comma separated list with User ID and Password |
newuseremail | Sends account information via email to user | Will reset password for account and send that password |
listusers | Returns a comma separated list of user accounts | List is formatted as userid, username, email address |
listusers2 | Identical to listusers, but includes a field indicating if account is active | List is formatted as userid, username, email address,enabled |
listservers | Returns a comma separated list of servers | List is formatted as userid, owner id, server name |
listservers2 | Identical to listservers but includes a field indicating if server is disabled | List is formatted as userid, owner id, server name,disabled |
serverinfo | Returns IP address and game port values of a server. | Output is in the format of IP:Port or just IP if port is 0 |
dbval | Returns a value from the database where i=id of table. o1=<table name>, o2=<column name> | For example i=1&o1=servers&o2=friendlyname would return the Friendly name of server id 1 |
updatedbserver | Updates a value in the database for a server. | o1= specifies the column to update, o2= new value |
updatedbuser | Updates a value in the database for a user. | o1= specifies the column to update, o2= new value |
pw | Reset password for account i=, use o1= for new password | |
listsdefs | List server definitions | List format: id, name, platform, ip |
listinstallers | List auto installer templates | List format: id, name, gametype, platform |
install | Create new server using auto installer, specifying where to install, who to make the owner, and maximum player slots. | o1= sdef id, o2= user id, o3= max slots |
installfast | Create new server using auto installer and returns new server ID as soon as it's available (install completes in the background), specifying where to install, who to make the owner, and maximum player slots. | o1= sdef id, o2= user id, o3= max slots |
installfastloc | Create new server using auto installer and returns new server ID as soon as it's available (install completes in the background), specifying the location for the server, a list of installers (one linux, one windows). The installer will pick the least utilized server definition assigned to a location. The panel will use the correct installer based on the platform type of the target server definition. Server is started once deployment is complete and a 'new server' welcome email is sent to owner. | i=owner_id, o1= installerid1,installerid2, o2= location_name, o3= max slots |
listinstallers | List auto installer templates | List format: id, name, gametype, platform |
synccache | Sync utility cache from Server def 1 to all remotes | Added in Ver 2.48 |
The panel will return either an
OK: - indicates everything was successful
ERROR: - indicates an error and will typically list an error message.
uget - Commandline API tool
You can use this tool to make api calls from the commandline. See http://www.brainless.us/forum/viewtopic.php?f=21&t=1493 for more information.