1-855-288-2260
We're here 24/7 to help!

API

Interact with our system programmatically from your own applications

How it works

The API is similar to the RESTful architecture, accepting and returning JSON data. Authentication is implemented as HTTP Basic Authentication over SSL (https). Failed authentication attempts return a 401 unauthorized. 20 failed authentication attempts lock out the requesting IP for 5 minutes (no response).

The examples below include the HTML contenteditable attribute to allow adjustment of credentials and/or IP address prior to copying and pasting elsewhere – e.g., your terminal.

List All Servers

URI: https://www.macstadium.com/core/api/servers
Request: GET
Return: JSON array of array{id,name,ip} or error string. Servers with multiple IPs will have multiple listings.

Example:

curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET -u user:pass https://www.macstadium.com/core/api/servers

Server Status by IP

URI: https://www.macstadium.com/core/api/servers/{ip_address}
Request: GET
Return: JSON array{id,name,power} or error string. Power can be ‘On’, ‘Off’, ‘Rebooting’, or ‘Error’.

Example:

curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET -u user:pass https://www.macstadium.com/core/api/servers/192.168.1.101

Sever Action (Power) by IP

URI: https://www.macstadium.com/core/api/servers/{ip_address}/{action}
Request: GET
Params: Action can be ‘On’,’Off’, or ‘Reboot’ (case insensitive).
Return: String. ‘True’ on success or an error message.

Example:

curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET -u user:pass https://www.macstadium.com/core/api/servers/192.168.1.101/reboot