NAV Navbar
Logo
shell ruby php

Introduction

Welcome to the developers documentation for installerr.com.

You can find on this page all the informations related to our API endpoint usage, along some examples in various programming language.

The API can be used to create zones programatically, or to retrieve download links dynamically.

Our API base url is https://api.installerr.com.

Authentication

All our endpoints require authentication. There are two authentication levels: user and site, depending on the scope of your request. These 2 levels are mutually exclusive.

Authentication consists of passing a secret API key along your request.

You can use the ping endpoint to test authentication.

User level authentication

All requests polling user’s level informations, such as account balance etc…, or creating sites.

<?php
$url = "https://api.installerr.com/USER-ENDPOINT";
$ch = curl_init();
$headers = array();
$headers[] = 'User-Api-Key: MYUSERKEY';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>
# With shell, you can just pass the correct header with each request
curl "https://api.installer.com/USER-ENDPOINT"
  -H "User-Api-Key: MYUSERKEY"

Make sure to replace MYUSERKEY with your corresponding User API key.

Site level authentication

All requests concerning a particular site. Each site has its own API key.

<?php
$url = "https://api.installerr.com/SITE-ENDPOINT";
$ch = curl_init();
$headers = array();
$headers[] = 'Site-Api-Key: MYSITEKEY';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>
# With shell, you can just pass the correct header with each request
curl "https://api.installer.com/USER-ENDPOINT"
  -H "Site-Api-Key: MYSITEKEY"

Make sure to replace MYSITEKEY with your corresponding Site API key.

Sites

All the following endpoints requires the site level authentication method. The manipulated site is determined by the authentication, since each site has its own API key.

Create a zone

The endpoint create a new zone. Returns a JSON doc.

curl -X POST 'http://api.installerr.com/zones' \
  --header 'Site-Api-Key: MYSITEKEY' \
  -F 'name=Article bottom'
<?php
$post = array("name" => "Article bottom");

$url = "https://api.installerr.com/zones";
$ch = curl_init();
$headers = array();
$headers[] = 'Site-Api-Key: MYSITEKEY';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

On success, this endpoint returns a JSON response like this:

{
  "code": "ok",
  "zone": {
    "id": 1,
    "name": "Article bottom",
    "site_id": 5
  }
}

On error, a JSON like this will be returned:

{
  "code": "ERROR_CODE"
}

Endpoint base url and method

POST http://api.installerr.com/zones

Post Parameters

Parameter Type Description
name string The name of the zone.

JSON Response

Key Type Description
code string/integer ok will always be returned on success, else will print an error code.
id integer ID of the newly created zone.
name string Name of the newly created zone.
site_id integer ID of the site the newly zone was created under.

On error, see the response code section for code description.

Edit a zone

This endpoint edit an existing zone. Returns a JSON doc.

curl -X PATCH 'http://api.installerr.com/zones/ZONE_ID' \
  --header 'Site-Api-Key: MYSITEKEY' \
  -F 'name=Article bottom'
<?php
$post = array("name" => "Article bottom");

$url = "https://api.installerr.com/zones/ZONE_ID";
$ch = curl_init();
$headers = array();
$headers[] = 'Site-Api-Key: MYSITEKEY';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

On success, this endpoint returns a JSON response like this:

{
  "code": "ok"
}

On error, a JSON like this will be returned:

{
  "code": "ERROR_CODE"
}

Endpoint base url and method

PATCH http://api.installerr.com/zones/ZONE_ID

Query params

Parameter Type Description
ZONE_ID integer ID of the zone to edit.

Patch Parameters

Parameter Type Description
name string The name of the zone.

JSON Response

Key Type Description
code string Response code.

See response code section for code details.

Dynamically retrieve a download link for a given file name and file path.

curl 'https://api.installerr.com/download_link?z=ZONE_ID&name=FILE_NAME&file= FILE_URL' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/download_link?z=ZONE_ID&name=FILE_NAME&file=FILE_URL";
$ch = curl_init();
$headers = array();
$headers[] = 'Site-Api-Key: MYSITEKEY';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

Endpoint base url and method

GET http://api.installerr.com/zones/download_link

Query params

Parameter Type Description
z integer ID of the zone that link is attached to.
name string Name of the file to download (eg. setup.exe, my_software.exe).
file string Location of the file to download. Must be a valid link starting by either http:// or https://.

Plain text Response

http://downloadserver.com/1234-1234-1234/setup.exe

User

All the following endpoints requires the user level authentication method.

Balance

Retrieve your current pending balance, in USD.

Endpoint base url and method

GET http://api.installerr.com/balance

curl 'http://api.installerr.com/balance' \
  --header 'User-Api-Key: MYUSERKEY'
<?php
$url = "https://api.installerr.com/balance";
$ch = curl_init();
$headers = array();
$headers[] = 'User-Api-Key: MYUSERKEY';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

On success, this endpoint returns a JSON response like this:

{
  "code": "ok",
  "balance": 123.45
}

On error, a JSON like this will be returned:

{
  "code": "ERROR_CODE"
}

JSON Response

Key Type Description
code string Response code.
balance float User’s pending balance.

Ping

Send a basic empty to test that you have implemented the authentication correctly.

Test user authentication

Test the user level authentication.

Endpoint base url and method

GET http://api.installerr.com/ping/user_auth

curl 'http://api.installerr.com/ping/user_auth' \
  --header 'User-Api-Key: MYUSERKEY'
<?php
$url = "https://api.installerr.com/ping/user_auth";
$ch = curl_init();
$headers = array();
$headers[] = 'User-Api-Key: MYUSERKEY';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

On success, this endpoint returns a JSON response like this:

{
  "code": "ok"
}

On error, a JSON like this will be returned:

{
  "code": "ERROR_CODE"
}

Test site authentication

Test the site level authentication.

Endpoint base url and method

GET http://api.installerr.com/ping/site_auth

curl 'http://api.installerr.com/ping/site_auth' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/ping/site_auth";
$ch = curl_init();
$headers = array();
$headers[] = 'Site-Api-Key: MYSITEKEY';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

On success, this endpoint returns a JSON response like this:

{
  "code": "ok"
}

On error, a JSON like this will be returned:

{
  "code": "ERROR_CODE"
}

Response code

API can return any of the following code:

Code Meaning
ok Request was successfull
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
410 Gone
418 I’m a teapot
429 Too Many Requests
500 Internal Server Error
503 Service Unavailable, try again later.