27 February 2023 Reading time: 6 minutes

API features in ISPsystem products


An API (Application programming interface) is a set of methods, rules, and functions that can be used to execute a particular part of the code. When we call any of the API request functions, we give some data as input and receive other data as output. This can be a program change made or a data list received.

You can use the API to perform routine operations, retrieve data stored in programs, or make changes to them. You can also use the API for integrations, writing scripts, bulk changes, and more.

ISPsystem ecosystem products have an open API. You can use API or configure integrations in BILLmanager, VMmanager, DCImanager, IPmanager, and DNSmanager to manage your tasks.

In this article, we will talk about the API features within our products.

API in ISPsystem products and useful links

For products that have COREmanager as their framework, such as BILLmanager, DNSmanager, and IPmanager, as well as all of the fifth generation of other platforms, please refer to the API work flowchart and documentation at our website. It describes authorization methods, data output formats, information on how to work with our API using the programming languages Python, PHP, perl, and a lot of other useful information.

To make writing bash scripts easier, you can use the mgrctl utility. It allows you to call the required API function directly from the command line. Detailed information about its use and examples of simple scripts are available at our website in the documentation section.

For these products it is possible to create API requests through the log, see the documentation for details

Now let's see how to work with the API in current versions of other products of the ISPsystem ecosystem.

We have devoted several sections of the documentation to VMmanager 6:
Description of the operating principle.
Examples of use.

Instructions for working with Swagger — a set of tools for the specification and automatic description of the API based on its code.

Similar sections are available for DCImanager 6:
Description of operation.
Examples of use.

But to effectively use the API in the sixth generation of VMmanager and DCImanager platforms, you will need to learn more about the HTTP protocol and methods.

The HTTP protocol and its methods. Data formats

HTTP (HyperText Transfer Protocol) is a set of application layer rules for transferring data. Most HTTP transfers involve the Client (the one who sends the request) and the Server (the one who sends the response). In some cases there is a third participant, the Proxy Server, as an intermediary.

To make a typical HTTP request, you will need to specify the following:

  1. URL (domain, server address).
  2. Method (the type of request or, in other words, the action to be performed).
  3. Header list (describe the message body, i.e. the parameters that are transmitted).
  4. The body (the values of the parameters themselves required for the transfer).

More information about HTTP can be found in the article on Wikipedia.

VMmanager 6 and DCImanager 6 support GET, POST and DELETE methods:

  • The Get method is used to request the contents of the specified resource.
  • The POST method is used to send user data to a given resource.
  • The DELETE method deletes the specified resource.

Only GET and POST methods are used for products with the COREmanager framework.

A POST request is sent in the JSON (JavaScript Object Notation) format, which consists of a key and a value.

The result obtained after executing the function with the products based COREmanager can be in XML format, text format, as well as JSON. To set the format in which you want to receive the data, you must specify the out=format_nameparameter.

Possible values of the out parameter:

  • xml - the data will be returned in XML format (the data is provided without pagination or filter);
  • devel - same as XML, but the document will contain data describing the user interface (useful for debugging your plugins);
  • text - data in text format (provided without pagination or filter);
  • sjson - data in JSON format;
  • json - same as sjson, only Pretty Print (useful for debugging);
  • JSONdata - same as JSON, but without interface descriptions, only data (provided without pagination or filter);
  • xjson - similar to the default output format (html) only in JSON format (recommended for creating your own design themes);
  • print - printable html, works only for lists of data;
  • xxxx - you can create your own output format if you are not satisfied with any of the previous ones.

If the out parameter is missing, it is assumed that the data is for the browser and is converted to html.

Version 6 products can only send a response in JSON format.

Advantages of API

API is a serious and powerful tool that does not require deep knowledge in programming, but is useful to solve everyday problems by automating them.

API can also be easily integrated into your code in any programming language. An API request can be used as an independent unit.

The set of functions and their parameters (values that can be transferred as the input) is different for each platform. By referring to the documentation, you can set up integrations between different products and software, as well as write different queries to retrieve the necessary data.