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.

Infos

This endpoint returns the current site global informations.

curl 'http://api.installerr.com/infos' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/infos";
$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:

{
  "id": 1,
  "url": "https://mysite.com",
  "last_event": 1510917968,
  "zones_count": 3
}

Endpoint base url and method

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

JSON Response

Returns an array of JSON object

Key Type Description
id integer Site ID.
url string Site url.
last_event integer Last activity (print/click/lead) unix timestamp.
zones_count integer Number of zones.

Get all zones

This endpoint returns all the current site’s zones.

curl 'http://api.installerr.com/zones' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$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_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

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

[
  {
    "id": 1,
    "name": "Article bottom"
  },
  {
    ...another zone object
  }
]

Endpoint base url and method

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

JSON Response

Returns an array of JSON object

Key Type Description
id integer Zone id.
name string Zone name.

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

Create a new 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

Stats

This endpoint returns the current site’s stats.

curl 'http://api.installerr.com/stats' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/stats";
$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:

{
  "all": {
    "prints_count": 0,
    "clicks_count": 0,
    "leads_count": 0,
    "click_rate": 0,
    "conversion_rate": 0,
    "cpm": 0.0,
    "earnings": 0.0
  },
  "zones": [
    {
      "zone_id": 1,
      "prints_count": 0,
      "clicks_count": 0,
      "leads_count": 0,
      "click_rate": 0,
      "conversion_rate": 0,
      "earnings": 0.0
    }
  ]
}

On error, a JSON like this will be returned:

{
  "code": "ERROR CODE",
  "message": "MORE DETAILS ABOUT ERROR"
}

Endpoint base url and method

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

Query params

All query params are optionals.

Parameter Type Default Description
start integer Your site first event time Unix timestamp for the stats lower time limit.
end integer Now Unix timestamp for the stats upper time limit.

JSON Response

The response contains 2 sections: all and zones.

all Aggregated stats for all your zones.
zones Details stats per zone

Each stats object follows the formatting:

Key Type Description
zone_id integer Zone ID (not applicable to all section).
prints_count integer Number of prints.
clicks_count integer Number of clicks.
leads_count integer Number of leads.
click_rate integer Click rate, in percentage
conversion_rate integer Conversion rate, in percentage.
earnings float Total earnings, in USD.

This endpoint returns the current site’s links analytics.

curl 'http://api.installerr.com/links' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/links";
$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:

[
  {
    "url": "https://mysite.com/download.zip",
    "prints_count": 0,
    "clicks_count": 0,
    "leads_count": 0,
    "click_rate": 0,
    "conversion_rate": 0,
    "earnings": 0.0,
    "last_activity": 1510917968
  },
  {
    ... another stats
  }
]

Endpoint base url and method

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

Query params

All query params are optionals.

Parameter Type Default Description
page integer 1 Page number

JSON Response

Key Type Description
url string Url of the download file.
prints_count integer Number of prints.
clicks_count integer Number of clicks.
leads_count integer Number of leads.
click_rate integer Click rate, in percentage
conversion_rate integer Conversion rate, in percentage.
earnings float USD payout for that link.
last_activity integer Unix timestamp of that url last activity.

By default, returns 25 links per page. Use the page query params to get more pages.

Demography

This endpoint returns information about the site’s demography repartition.

curl 'http://api.installerr.com/demography' \
  --header 'Site-Api-Key: MYSITEKEY'
<?php
$url = "https://api.installerr.com/demography";
$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:

{
  "countries": {
    "USA": 22.5
    "JPN": 15,
    ...
  },
  "operating_system": {
    "Mac": 15.2,
    "Windows": 25.6,
    "iOS": 0.3,
    ...
  },
  "devices": {
    "Desktop": 12.2,
    "Smartphone": 12.0,
    ...
  }
}

Endpoint base url and method

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

JSON Response

Key Type Description
countries object Countries stats: each key correspond to a 3-letter country code, value is traffic percentage
operating_system object Operating system stats, key is the Operating System name, value is traffic percentage.
devices object Devices stats, key is the device name, value is the traffic percentage.

See code example for more informations.

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.