API: Connecting
Introduction
ATMAN API allows to manage whole ATMAN infrastructure using a standardized programmatic interface. Using ATMAN API, you can do just about anything you can do on control panel. The ATMAN API is based on XML requests and responses. As an alternative, you can use SOAP.
Best practices
Use separate API user
We suggest to use separate user to access API and set its access rights to minimum required.
Caching requests
We suggest to cache information which does not change frequently i.e. trouble ticket department list or priorities.
Using API
API URL
To send a command, you need to send POST
request to API URL – URL is shown in control panel, usually it is https://panel.atman.pl/api/xml
.
Authentication
You can use control panel credentials to access API. It is advised to use separate user dedicated for API access.
XML API
Request
<?xml version="1.0"?>
<request>
<user>
<mail>[api_user]</mail>
<password>[api_password]</password>
</user>
<command>
<name>[command name]</name>
[command parameters]
</command>
</request>
Response
<?xml version="1.0"?>
<response>
<status>ok</status>
<message>Command OK</message>
[command specific response]
</response>
Sample command
Request
<?xml version="1.0"?>
<request>
<user>
<mail>sample_user</mail>
<password>sample_password</password>
</user>
<command>
<name>server.ipmi.start</name>
<serverId>xxx</serverId>
<sourceAddress>aaa.aaa.aaa.aaa/bb</sourceAddress>
</command>
</request>
Response
<?xml version="1.0"?>
<response>
<status>ok</status>
<message>Command OK</message>
<ipmi>
<status>active</status>
<address>xxx.xxx.xxx.xxx</address>
<login>yyy</login>
<password>zzz</password>
<sourceAddress>aaa.aaa.aaa.aaa/bb</sourceAddress>
<endTime>ccc</endTime>
</ipmi>
</response>