My API script isn't working
If you're trying to post some data to DirectAdmin with the API, but are not getting the desired results, rather than trying to figure out what's wrong with your scirpt, it's usually easier to be shown what you're passing and what should be passed.
To do this, run DirectAdmin in debug mode
, with the "| grep string" option. This will show you what's being passed.
Then test the function you want with your browser normally through DA (without your script). The posted data will be shown in the debug output.
Lastly, test the function using your API script. Again, the data being passed will be shown. Compare the output generated from your script with the output generated from the browser. Adjust your script to match, and it should work.
- You can only show CMD_* class in the output by setting
./directadmin set debug_only_cmd 1
- DA binaries compiled after April 1, 2020 can use debug level exactly 188 to show only the request information.