Calling hook from WHM API 1 for account create

edlemmers

Member
Jan 30, 2013
7
0
1
cPanel Access Level
Root Administrator
I have a script registered to the account create API. I also have a cURL operation that is using a JSON-encoded URL to run the account created command thru the API. This part is working in that it does create the CPanel account properly. What is the correct way pass a variable to the hooked script I have registered? This is the URL that I have:

PHP:
$query = "https://" . $server_creds['whmserver'] . ":2087/json-api/createacct?api.version=1&username=$username&domain=$domain&plan=$plan&password=$password&contactemail=$contactemail&owner=" . $server_creds['reseller'] . "&@hook_args=$username&quota=$quota";
$server_creds is an array which includes the hash code and everything else need to authorize the API call. The other parameters are passed using jQuery AJAX but could also be just a form POST.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
Hello,

You could trap the custom variable in your custom script, store it to file, and then retrieve the variable from that file. However, could you elaborate a little more on the purpose of this configuration so we can better understand what you are attempting to do?

Thank you.