The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can you create a MySQL DB via API json call?

Discussion in 'cPanel Developers' started by Chuck Burgess, Oct 21, 2011.

  1. Chuck Burgess

    Chuck Burgess Registered

    Joined:
    Oct 21, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,460
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I've moved your post to the Developers Forum in the hopes one of the cPanel Developers will see it and help if possible.
     
  3. sirdopes

    sirdopes Well-Known Member
    PartnerNOC

    Joined:
    Sep 25, 2007
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
Loading...

Share This Page