Add to Favourites Add to Favourites    Print this Article Print this Article

Creating an API: Starting point

DirectAdmin has a feature-set which allows you to control almost everything you can via a browser, but using socket based scripts instead.  This is called an "API".

There are hundreds of possible API commands.
Essentially, anything you can do normally in a browser, you can also do with the API.. just swap CMD_name to CMD_API_name (replace "name" with whatever the browser had), and use the same variables as the browser does.   Search for that CMD_API_name value in the Versions System

Starting point and main API documentation:
http://www.directadmin.com/api.html

Php communication class:
http://forum.directadmin.com/showthread.php?t=258

Some API command are listed in the api.html page above, but most only exist in the versions system:
http://www.directadmin.com/search_versions.php?query=CMD_API

More examples:
http://www.directadmin.com/sample_api.txt
http://files.directadmin.com/services/all/httpsocket/examples/


Also, we recommend creating a "Login Key" for any permanent API login values.. so you can restrict that key to login only from certain IPs, and to only access certain CMD_API calls that you specify.
http://help.directadmin.com/item.php?id=523

The "key" is just a different password, the same login name is used (DA username, eg: "admin")

Was this answer helpful?

Also Read