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:

Php communication class:

Some API command are listed in the api.html page above, but most only exist in the versions system:

More 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.

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

Was this answer helpful?

Also Read