createacct function from within your custom script:
/xml-api/createacct function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/xml-api/createacct
createacct function from within your custom script:
/json-api/createacct function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/json-api/createacct
createacct function takes the following variables as input.
The following variables are required: user
domain.tld
reseller_gold
reseller_silver
1 — yes.
0 — no.
no_ftp_100mb_gold
0 is unlimited.
p@ss!w0rd$123
y — yes.
n — no.
1 — yes.
0 — no.
1 — yes.
0 — no.
1 — yes.
0 — no.
user@otherdomain.tld
x3
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
unlimited
null
0 is unlimited.
spanish-utf8
1 — yes.
0 — no.
1 if you are using the above option.
1 — yes.
0 — no.
local — The domain will accept mail, regardless of whether a higher-priority mail exchanger has been designated on the WHM Edit MX Entry screen. (If a higher-priority mail exchanger exists, mail will be routed to both domains.)
secondary (or backup) — The domain will act as a backup mail exchanger, holding mail in queue if the primary exchanger becomes unavailable. remote — The domain will not accept mail, instead sending it to the primary mail exchanger. auto — The server will automatically detect, and use, the configuration set on the WHM Edit MX Entry screen.
createacct function. 123.456.789.10
nameserver may be appended by an integer (x) between 1 and 5. Example: nameserver1
nameservera may be appended by an integer (x) between 1 and 5. Example: nameservera1
nameserverentry may appear appended by an integer (x) between 1 and 5. Example: nameserverentry1
1 — success.
0 — failure.
https://example.com:2087/xml-api/createacct?username=myuser&plan=basic
&ip=n&cpmod=x3&password=h@rd2gu3ss!p@ss&contact email=username
@domain.tld&domain=domain.tld&useregns=0&reseller=0
will produce output similar to:
<createacct>
<result>
<options>
<ip>192.168.1.1</ip>
<nameserver>ns1.domain.tld</nameserver>
<nameserver2>ns2.domain.tld</nameserver2>
<nameserver3/>
<nameserver4/>
<nameservera/>
<nameservera2/>
<nameservera3/>
<nameservera4/>
<nameserverentry/>
<nameserverentry2/>
<nameserverentry3/>
<nameserverentry4/>
<package>basic</package>
</options>
<rawout>
Checking input data...The ProFTPd configuration file /etc/proftpd.conf appears to be ok!
System has 0 free ips.
...Done
WWWAcct 12.1.0 (c) 1997-2008 cPanel, Inc....
Dns Zone check is enabled.
+===================================+
| New Account Info |
+===================================+
| Domain: domain.tld
| Ip: 208.77.188.166 (n)
| HasCgi: y
| UserName: myuser
| PassWord: h@rd2gu3ss!p@ss
| CpanelMod: x3
| HomeRoot: /home
| Quota: 0 Meg
| NameServer1: ns1.example.com
| NameServer2: ns2.example.com
| NameServer3: ns1.domain.com
| NameServer4:
| Contact Email: username@domain.tld
| Package: basic
| Feature List: default
| Language: english
+===================================+
...Done
Running pre creation script (/scripts/prewwwacct)......Done
Adding User...Removing Shell Access (n)
...Done
Copying skel files from /root/cpanel3-skel/ to /home/myuser/......Done
Adding Entries to httpd.conf......Done
Setting up Mail and Local Domains...localdomains...
valiases ...vdomainaliases...vfilters......Done
Configuring DNS...Bind reconfiguring on server1 using rndc
...Done
Restarting apache......Done
Changing password for myuser Password for myuser has been changed
Updating Authentication Databases...Updating ftp passwords for myuser
Ftp password files updated.
Ftp vhost passwords synced
...Done
Verifying MX Records and Setting up Databases......Done
Setting up Proxy Subdomains......Done
Bind reloading on server1 using rndc zone: [domain.tld]
Sending Account Information......Done
System has 0 free ips.
Running post creation scripts (/scripts/legacypostwwwacct,
/scripts/postwwwacct, /scripts/postwwwacctuser)......Done
wwwacct creation finished
Setting up Domain Pointers......Done
Setting Reseller Privs......Done
Account Creation Complete!!!...Account Creation Ok...Done
</rawout>
<status>1</status>
<statusmsg>Account Creation Ok</statusmsg>
</result>
</createacct>
https://example.net:2087/json-api/createacct?username=user123&plan=level3
&ip=n&cpmod=x3&password=h@rd2gu3ss!p@ss&contact%20email=username
@example.com&domain=example.com&useregns=0&reseller=0
will produce output similar to:
{
"result":[
{
"status":1,
"statusmsg":"Account Creation Ok",
"rawout":"<table style=\"border- bottom: 1px #ccc dotted;\"><tr><td width=\"100%\">
<pre>Checking input data...System has 2 free ips.\n...Done</pre></td><td width=\"30\">
<img align=absmiddle src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td>
</tr></table>\n<table style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\">
<pre>WWWAcct 12.1.0 (c) 1997-2008 cPanel, Inc....\n\nDns Zone check is enabled.
\n+===================================+\n| New Account Info
|\n+===================================+\n| Domain: example.com\n| Ip: 127.0.0.1
(n)\n| HasCgi: y\n| UserName: user123\n| PassWord: h@rd2gu3ss!p@ss\n| CpanelMod:
x3\n| HomeRoot: /home\n| Quota: 0 Meg\n| NameServer1: ns1.example.net\n|
NameServer2: ns2.example.net\n| NameServer3: ns1.example.com\n| NameServer4:
ns2.example.com\n| Contact Email: \n| Package: level3==\n| Feature List: default\n|
Language: english\n+===================================+\n...Done</pre>
</td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\">
</td></tr></table>\n<table style=\"border-bottom: 1px #ccc dotted;\"><tr><td
width=\"100%\"><pre>Running pre creation script
(/scripts/prewwwacct)......Done</pre></td><td width=\"30\"><img
align=absmiddlesrc=\"/cPanel_magic_revision_ 1181098607/icons/good.gif\">
</td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr> <td
width=\"100%\"><pre>Adding User...Removing Shell Access (n)\n...Done</pre>
</td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\">
</td></tr></table>\n<table style=\"border-bottom: 1px #ccc dotted;\">
<tr><td width=\"100%\"><pre>Copying skel files from /root/cpanel3-skel/ to
/home/user123/......Done</pre></td><td width=\"30\"> <img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Adding Entries
to httpd.conf......Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Setting up Mail
& Local Domains...localdomains...valiases ...vdomainaliases...vfilters......Done</pre></td>
<td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Configuring
DNS...Bind reconfiguring on publicdocs using rndc\n...Done</pre></td><td width=\"30\">
<img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Restarting
apache......Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\nChanging
password for user123\nPassword for user123 has been changed\n<table style=\"border-
bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Updating Authentication
Databases...Updating ftp passwords for user123\nFtp password files updated.\nFtp vhost
passwords synced\n...Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\">
</td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Verifying MX
Records and Setting up Databases......Done</pre></td><td width=\"30\"><img
align=absmiddle src=\"/cPanel_magic_revision_1181098607/icons/good.gif\">
</td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Setting up
Proxy Subdomains......Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\nBind
reloading on publicdocs using rndc zone: [example.com]\n<table style=\"border-bottom:
1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Sending Account
Information......Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td>
</tr></table>\nSystem has 2 free ips.\n<table style=\"border-bottom: 1px #ccc dotted;\">
<tr><td width=\"100%\"><pre>Running post creation scripts (/scripts/legacypostwwwacct,
/scripts/postwwwacct, /scripts/postwwwacctuser)......Done</pre></td><td width=\"30\">
<img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr>
</table>\nwwwacct creation finished\n<table style=\"border-bottom: 1px #ccc dotted;\">
<tr><td width=\"100%\"><pre>Setting up Domain Pointers......Done</pre></td><td
width=\"30\"> <img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>
\n<table style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\">
<pre>Setting Reseller Privs......Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n<table
style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Account Creation
Complete!!!...Account Creation Ok...Done</pre></td><td width=\"30\"><img align=absmiddle
src=\"/cPanel_magic_revision_1181098607/icons/good.gif\"></td></tr></table>\n",
"options":{
"nameserver4":"ns2.example.com",
"nameserver":"ns1.example.net",
"nameserverentry2":null,
"nameserverentry3":null,
"nameserverentry4":null,
"nameserverentry":null,
"ip":"127.0.0.1",
"nameservera2":null,
"nameservera3":null,
"package":"level3==",
"nameservera4":null,
"nameserver2":"ns2.cpanelrocks.net",
"nameservera":null,
"nameserver3":"ns1.example.com"
}
}
]
}
Copyright © cPanel 2000-2009.