Can you create a MySQL DB via API json call?

Chuck Burgess

Registered
Oct 21, 2011
1
0
51
Cedar Hills, Utah, United States
cPanel Access Level
Website Owner
I am looking to automate the creation of a MySQL database via a json api call. To list dbs, I can just use something like:

https://example.com:2083/json-api/c...jsonapi_func=listdbs&cpanel_jsonapi_version=2

This is successful via HTTP Sockets and CURL. Is there any equivalent call for adddb?


https://example.com:2083/json-api/c...c=adddb&cpanel_jsonapi_version=1&dbname=newdb

This doesn't work. I get the following error:


“username_†is an invalid database name. It contains invalid characters.

Any help?