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.

Access Denied using API to create account

Discussion in 'cPanel Developers' started by sam.hargreaves, Jan 19, 2015.

  1. sam.hargreaves

    sam.hargreaves Registered

    Joined:
    Oct 25, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hi,

    I'm using the following :

    Code:
    https://example.com:2087/xml-api/createacct?
    username=myuser&
    plan=basic%20&
    ip=n&
    cpmod=x3&
    password=h@rd2gu3ss!p@ss&
    contact%20email=username%20@domain.tld&      <-- "contactemail=username@domain.tld"
    domain=domain.tld&
    useregns=0&
    reseller=0
    I am however getting an Access Denied error returning in the XML.

    Is this the correct code to create an account via the API? Does anything need to be enabled in WHM to use it?

    Cheers,
    Sam
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,775
    Likes Received:
    663
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    How are you formulating the URL? It should be on a single line. EX:

    Code:
    /json-api/createacct?api.version=1&username=cptest09&domain=cptest09.com&plan=cp123&cpmod=x3&useregns=0&ip=n&reseller=0&password=123%24%24lug%23ge&contactemail=admin%40cptest09.com 
    Thank you.
     
Loading...

Share This Page