How to create WHM/ROOT WHM API token using WHM API
Hi there!
Essentially, the question is how to generate the token using API before it's created?
We're using WHM/cPanel API to create a cPanel account under WHM level (by'createacct' API) with the "reseller" privileges so that a new WHM account has been created automatically too (if I understand that correctly). In order to use regular WHM API endpoints for this new account we need API token generated, but the question is how to generate that token and what auth parameters I should use for the endpoint (because we don't have this token generated yet). "cp_security_token" token doesn't work either.
Hope for your help and thank you
-
Well, if I'm understanding you correctly, you've just created a reseller account in WHM. Presumably that means your script knows the username and password of the reseller you just created. Then it's just a question of: * Making sure the reseller you setup has the correct privileges to create API tokens for itself (as root). See https://api.docs.cpanel.net/openapi/whm/operation/saveacllist/
and use theacl-manage-api-tokens
to manage whether the reseller account can create tokens for itself. * Setting up your headers to useBasic
authentication with the reseller's username and password, then creating the API token (as the reseller).0 -
Ohh thank you again, yep, you got me right alt="">https://web.telegram.org/a/img-apple-64/1f64f.png
alt="">https://web.telegram.org/a/img-apple-64/1f64f.png0
Please sign in to leave a comment.
Comments
2 comments