API

Post Reply
Masher
Site Admin
Posts: 3438
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Hearland
Contact:

API

Post by Masher » Fri Jun 26, 2009 2:50 pm

The API allows you control the panel using a special URL with various options. You can manage users and servers through the API. If you'd like additional features added to the API please contact us.

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.

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

Where
u = your username
p = your password
c = the command (see below)
i = id to perform the command on
o1 = some commands support additional parameters specified by using o1
o2 = some commands support additional parameters specified by using o2

Implemented commands
alive = useful to see if the panel is alive, always returns True
running = see if a server is running or not, returns True or False
start = starts a server
stop = stops a server
restart = stops/starts a server
restartempty = restart the server when the amount of players is below the min player count setting
disables = disables a server
enables = enables a server
disableu = disable an user's account (id is the user's account id)
enableu = enable an user's account (id is the user's account id)
extra = runs the specified extra program
pw:<newpassword> = replace <newpassword> with the desired password to set a password for the account of the user with specified ID
newuser = create a new user. Specify account name as o1, email address as o2. Panel will return a comma seperate list with User ID and password
listusers = Returns a comma separated list of user accounts in the format user id, account name, email address
listservers = Returns a comma separated list of servers in the format id, owner's user id, server name
updatedbserver = Updates a value in the database for a server. o1 specifies the column name, o2 specifies the new value.
updatedbuser = Updates a value in the database for a user. o1 specifies the column name, o2 specifies the new value.
status = Returns the status of a server. Possible return values are 'Running', 'Updating', 'Stopped'.
update = Starts the update tool of specified server. You can use the status command to watch for when update has finished.
hashes = Updates the hashes for the server if enabled
newuseremail = Sends a user their account information and panel URL
query = Returns status of the game server (name, map, players)

Return values
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 viewtopic.php?f=21&t=1493 for more information.
Last edited by Masher on Tue Apr 10, 2018 1:03 am, edited 1 time in total.
Reason: Added query info added in 1.95
Masher
-----------
Please do not PM me unless asked to! We are a small company and if you have an issue or question it would be best to post it in the forums where it can help others in the future.

Need an affordable web control panel? Try UGCC.

Post Reply