1.11. Working with the API
- Open the section «API»:
- In the tab «Access data» check the box next to «I agree to the user agreement and terms of service» and press «Activate token»:
Limits on the number of requests to the API:
- No more than 300 requests per hour.
- Per day — no more than 5000 requests.
Information about the time of the last request and the current number of sent requests is displayed in the section «API».
Attention!It is highly recommended to set API access restriction by IP.
Access restrictions are configured on the tab «Access restriction»:
The logic of work is as follows:
- The address list is empty - access is open for all.
- There is one or more addresses in the list — access is open only for addresses from the list, closed for the rest.
Addresses and subnets in CIDR format are added to the list of allowed by the button «Add IP to the list of allowed». All added addresses are displayed in the list below. You can add a note to each of them or remove it from the list.
You can get acquainted with the list of methods, their descriptions, test their work and get code examples on the tab «Documentation». The tab consists of several blocks.
Attention!The documentation is being finalized, so not all methods have detailed descriptions.
The block with the name of the selected method contains its detailed description:
- The method for sending the request is GET or POST.
- URL - the address to which the request should be sent.
- Parameters - a list of available parameters, data types for each of them and options for available values.
- Detailed description of the method and its return values (not for all methods).
On the left side of the block «Request execution» there is a form for quickly sending a request on behalf of the current account, in the right one displays the response code and the result of the sent request:
In the block «Code example» shows example code for using the current method using cURL or a library HostingAPI:
- Current active the token is automatically substituted into the string with the parameter
$auth_token. If the token is not active, it will need to be activated and manually substituted into the code.
- Parameters from shape after the query is executed, they are automatically substituted into the string with the parameter
$post. If the request was not executed, the parameters will need to be specified independently.