The Lumturio API is organized around REST.
Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors.
JSON will be returned in all responses from the API, including errors.
You authenticate to the Lumturio API by providing your secret API key in the request. You can manage your API keys from your account.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
To authenticate will you need to provide the following header:
X-API-TOKEN: <Your-Api-Key>
The token can be found in your account under settings in the tab 'API Key'.
Below you can find a working PHP example:
<?php DEFINE('API_URL', "https://app.lumturio.com/api/"); DEFINE('API_TOKEN', "<Your-Api-Key>"); $result = callApi("/site.getsites"); if($result->ok == true) { $sites = $result->items; foreach($sites as $site) { if($site->need_engine_update == 1) { echo $site->site_url; } } } function callApi($path) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, API_URL . $path); curl_setopt($ch, CURLOPT_VERBOSE, false); // enable this to debug curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // leave this to true to avoid man in the middle attacks curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true); // leave this to true to avoid man in the middle attacks curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-API-TOKEN:' . API_TOKEN)); return json_decode(curl_exec($ch)); } ?>
If the example above is not working and after enabling the CURLOPT_VERBOSE option you get the following warning
* SSL certificate problem: unable to get local issuer certificate
This error by OpenSSL means the program was unable to verify the issuer of the certificate or the topmost certificate of a provided chain. To resolve this you can specify a more recent database of trusted root certificates.
curl_setopt($ch, CURLOPT_CAINFO, 'cacert.pem');
You can download a cacert.pem file generated from mozilla.org from here, or provide your own.
Our Sites object is easy to use and lets you assess essential information at a glance: number of websites, outstanding security updates, outstanding module updates or Drupal core updates.
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.getsites
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" --data "param1=value1¶m2=value2" https://app.lumturio.com/api/site.addsite
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" --data "param1=value1¶m2=value2" https://app.lumturio.com/api/site.set/<your_site_id>/settings
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.get/<your_site_id>
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.scan/<your_site_id>
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.scansites
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.get/<your_site_id>/module/<selected_module_shortname>
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.get/<your_site_id>/history
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/site.get/<your_site_id>/crawlstats
Output:
The module ibect is the entry point to all information related to your websites’ modules. On this page you can search and filter using a free text field, or you can select to filter information for actively maintained, actively developed or unsupported modules.
The module usage stats are very powerful. As an example, the module usages stats allow you to see on how many websites you are using a particular module, whether that module is actively maintained, still in development or unsupported, and what the different versions of the module across your installations are.
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/module.getmodules
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/module.get/<module_short_name>
Output:
Our instant notification feature is a powerful customization tool that allows you to set your own notification triggers for each of your websites, based on events you wish to monitor. This can be a feature or security update on a certain module, all modules or Drupal core.
Usage:
curl --header "X-API-TOKEN:Your-Token" -X GET https://app.lumturio.com/api/trigger.gettriggers
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" --data "param1=value1¶m2=value2" https://app.lumturio.com/api/trigger.add
Parameters
'action','site_id','module_short_name','notify_email'
Output:
Usage:
curl --header "X-API-TOKEN:Your-Token" --data "param1=value1¶m2=value2" https://app.lumturio.com/api/trigger.remove
Parameters:
'trigger_id'
Output:
we subscribe to all available mailing lists, workgroups, IRC channels and available security information. This guarantees that we can filter out the noise and only report actionable security tasks to you.
Usage:
curl --header "X-API-TOKEN:Your-Token" --data "param1=value1¶m2=value2" https://app.lumturio.com/api/security.getadvisory
Output: