ServicePilot SaaS Documentation

API

The ServicePilot API allows you to easily list your monitored assets, and makes it possible for external apps and ServicePilot agents to interact with ServicePilot's data. The API is REST based with JSON responses.

Resource management using REST API

To be able to use the REST API, an API Key is required. Obtain an API Key and use this when calling the REST interface.

Obtaining a ServicePilot API Key

Open the API Keys page to manage API Keys for ServicePilot Agents and the REST API. It is suggested to use an API Key dedicated to the REST interface with Read, Read & Write or Read, Write & Delete privileges depending on what access is required. If this key is compromised, it can be removed without affecting ServicePilot agent data gathering.

  1. Using a user with administrative privileges, log in to ServicePilot.
  2. Open configuration Configuration icon
  3. Navigate to KeysKeys menu item
  4. Create and note down an API Key with the required authorization Key list

Get a list of resources

To obtain a list of all resources, call this REST method with a Read capable API Key. The curl command below is an example request using the 10000000-0000-0000-0000-000000000000 API Key to https://cloud.servicepilot.com.

curl -H "X-Api-Key: 10000000-0000-0000-0000-000000000000" -X GET "https://cloud.servicepilot.com/api/resources"

Get information about a resource

To obtain information about a particular resource, call this REST method with a Read capable API Key. The curl command below is an example request using the 10000000-0000-0000-0000-000000000000 API Key to https://cloud.servicepilot.com. It will obtain information about the internalstatistics resource.

curl -H "X-Api-Key: 10000000-0000-0000-0000-000000000000" -X GET "https://cloud.servicepilot.com/api/resources/internalstatistics"

Add a resource

To add a new resource, call this REST method with a Write capable API Key. The curl command below is an example request using the 10000000-0000-0000-0000-000000000000 API Key to https://cloud.servicepilot.com. It will create a new resource named dns resource with the parameters presented.

Not all parameters are required. Depending on the resource type, the answers list will differ.

curl -H "X-Api-Key: 10000000-0000-0000-0000-000000000000" -X PUT "https://cloud.servicepilot.com/api/resources/dns" -d "{'package': 'appmon-dns', 'view': 'main', 'agent':'', 'agentpingsnmp':'', 'x': '150', 'y': '150', 'width': '30', 'height': '30', 'shape': 'image', 'picture': 'server.svg', 'backcolor': '#000000', 'borderwidth': '1', 'bordercolor': '#777777', 'borderstyle': 'solid', 'opacity': '100', 'backgroundcolorexist': 'true', 'html': '', 'policy': '', 'answers': {'dns_server_ip_address':'10.1.1.1','hostname_fqdn_to_resolve':'www.servicepilot.com','polling_interval':'60','timeout':'5'}}"

To see a list of parameters that are required and optional, go to the ServicePilot API details page.

  1. Using a user with administrative privileges, log in to the ServicePilot web pages.
  2. Open configuration Configuration icon
  3. Navigate to API API menu button
  4. Set the Method to PUT and select the required Package

The parameters will be listed as a list as well as the cURL request example presented to the right.

Delete a resource

To obtain information about a particular resource, call this REST method with a Delete capable API Key. The curl command below is an example request using the 10000000-0000-0000-0000-000000000000 API Key to https://cloud.servicepilot.com. It will delete the internalstatistics resource.

curl -H "X-Api-Key: 10000000-0000-0000-0000-000000000000" -X DELETE "https://cloud.servicepilot.com/api/resources/internalstatistics"

Adding resources from the Agent

It is possible to automatically add resources to monitor from the ServicePilot Windows Agents. The aim being to automate the addition of resources associated with an agent as soon as the new Agent becomes available.

To determine the syntax of the line to add in the Agent configuration, use the ServicePilot, go to the ServicePilot API details page.

  1. Using a user with administrative privileges, log in to the ServicePilot web pages.
  2. Open configuration Configuration icon
  3. Navigate to API API menu button
  4. Set the Method to PUT and select the required Package

The parameters will be listed as a list as well as the Auto-provisioning request (Agent side) example presented to the right.

Resources can be added, one per line to the ServicePilot Agent Setup Console, Auto-provisioning dialog.

Setup Console Auto-provisioning

If an automated installation of the ServicePiot Agent is performed, the Auto-provisioning data is stored under the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\ServicePilot Technologies\WindowsAgent\AutoProvisioning

Get started Now