Hi everybody.
We're developing a 3rd part app using whm/cpanel API. We have to set up a fully automated process of creating cPanel accounts and generating API tokens to be able to trigger cpanel functions via API. We faced the issue of generating token, here are the steps we're trying to accomplish (GET):
1. That successfully creates a cpanel user (whm API):
https://{{example_hostname}}.servconfig.com:2087/json-api/createacct?api.version=1&username={{exampleuser}}&domain={{example_user}}.com
2. That successfully creates cpanel user session (whm API):
https://{{example_hostname}}.servconfig.com:2087/create_user_session ?api.version=1&user={{example_user}}&service=cpaneld
3. This is where we got stuck on trying to create an API token (cpanel API):
https://{{example_hostname}}.servconfig.com:2083/{{cpsess1234567890 - generated from previous step}}/execute/Tokens/create_full_access?name={{example_token_name}}
Trying to use this cpsess1234567890 instead of BasicAuth as there's no API token generated yet, but getting nothing (user login html) in response.
Hope for your help guys
We're developing a 3rd part app using whm/cpanel API. We have to set up a fully automated process of creating cPanel accounts and generating API tokens to be able to trigger cpanel functions via API. We faced the issue of generating token, here are the steps we're trying to accomplish (GET):
1. That successfully creates a cpanel user (whm API):
https://{{example_hostname}}.servconfig.com:2087/json-api/createacct?api.version=1&username={{exampleuser}}&domain={{example_user}}.com
2. That successfully creates cpanel user session (whm API):
https://{{example_hostname}}.servconfig.com:2087/create_user_session ?api.version=1&user={{example_user}}&service=cpaneld
3. This is where we got stuck on trying to create an API token (cpanel API):
https://{{example_hostname}}.servconfig.com:2083/{{cpsess1234567890 - generated from previous step}}/execute/Tokens/create_full_access?name={{example_token_name}}
Trying to use this cpsess1234567890 instead of BasicAuth as there's no API token generated yet, but getting nothing (user login html) in response.
Hope for your help guys
Last edited by a moderator: