API Usage and Methods

Most Helpful Article

API Usage

All customers can use POST or GET to obtain or send data to our API. In addition, any customer that chooses to use the API must add the IP address of the system attempting to access the API in the Control Panel -> Administrative -> API portion of their control panel. After adding an IP to the list of authorized hosts in your API control panel you will see the API key next to the IP address in the list. This API key is specific to this IP address and your server control panel account.

You MUST edit the privileges of the newly added IP if you want it to be able to access the API’s methods.

The base URL is:

An example would be:

The request above from an authorized host would return your account’s current balance.

Available Methods and Actions

Module Action Arguments Description
billing getbalance Get current account balance.
billing history List your billing history.
billing pay invoiceid – (int) Required
sourceid – (int) Required
Pay an invoice.
billing sources List your billing sources.
billing unpaid Lists unpaid invoices.
dns setreverse ipaddress – (varchar) IP Address of record to update
value – (varchar) New hostname for rDNS
Sets the Reverse DNS entry for an IP Address assigned to you.
servers list Lists your current servers and the details associated with them.
servers rename newname – (varchar) The new display name
serverid – (varchar) LSN-D#### of the system.
Renames the server’s visible designation.
servers restart serverid – (varchar) LSN-D#### of the system. Restarts the specified server.
servers turnoff serverid – (varchar) LSN-D#### of the system. Turns off the specified server.
servers turnon serverid – (varchar) LSN-D#### of the system. Turns on the specified server.
servers portcontrol serverid – (varchar) LSN-D#### of the system.
port – (enum) public or private
set – (enum) on or off
Turns on or off the specified server’s network port.
servers bwgraph serverid – (varchar) LSN-D#### of the system.
start – (int) Optional, Start time via UNIX timestamp
stop – (int) Optional, Stop time via UNIX timestamp
Returns bandwidth graph for public network in PNG format. This action is not returned in XML.
servers getOperatingSystems Returns a list of operating systems to use with servers->reload
servers reload server_id – (varchar) LSN-D#### of the system.
os – (int) Required
password – (string) Required
Reload a server’s operating system. Get the “os” ID from servers->getOperatingSystems
ipaddresses list server_id – (varchar) Optional, LSN-D#### of the system.
network – (enum) public or private.
type – (enum) network, gateway, available or broadcast
List details about your IP Addresses. Specifying the optional parameters will filter the results.
support addticket probtype – (int) Required
summary – (text) Required
description – (text) Required
user_id – (int) Required
server – (varchar) Optional, LSN-D#### of the system
admin_user – (text) (POST ONLY) Optional
admin_pass (text) (POST ONLY) Optional
Add a support ticket to our control panel.
support listtickets status – (enum) Optional, open or closed List your tickets. By default, all tickets are shown.
support getprobtypes Returns a list of Problem Types (probtype) to send when using support->addticket.
support setstatus ticket – (int) Required Ticket ID
user_id – (int) Required
status – (enum) open or closed
Set the status of a ticket. Tickets not taken by a tech cannot be closed.
support updateticket ticket – (int) (Ticket ID) Required
user_id – (int) Required
message – (text) Required
Update a ticket with a response.
support viewticket ticket – (int) (Ticket ID) Required
users list List all of the users on your account with detail.

Returned Data Samples

Data returned from the API is in basic XML format. The following are examples of the data returned for each of the methods and their respective actions.

Billing

The ‘getbalance’ action will return your client ID and account balance, the value expressed is USD.

 

The ‘history’ action will return a list of invoices. Each invoice includes the date of invoice, due date, short description, status, and list of payments pertaining to each invoice. A paid invoice will have an invoices->invoice->status of completed.

Servers

The ‘list’ action will return the list of servers available in the control panel. The list includes each server’s ID, display name, public/private ips, power/port status, and bandwidth usage.

Code Samples

The following are some simple examples of how to query data from the API.

Simple PHP Example

The following example requires the simplexml_load_file function which is included with PHP5 but not PHP4.

 

Rate This Article

(361 out of 572 people found this article helpful)

About The Author