polojuni

Member
Sep 19, 2018
7
0
1
Cameroon
cPanel Access Level
Root Administrator
Hello please, I am trying to use the rest API offered by WHM to create a cpanel account. I have created the token and tested a route in the documentation but every route returns me

{"cpanelresult":{"apiversion":"2","error":"Access denied","data":{"reason":"Access denied","result":"0"},"type":"text"}}

Please how to solve this problem
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,183
2,413
363
cPanel Access Level
Root Administrator
Hey there! As a test, can you run this on the command line of the server to ensure that your token is working properly?

Code:
curl -H'Authorization: cpanel username:APITOKEN' 'https://example.com:2083/execute/Module/function?parameter=value'
If that works well, the issue is likely related to something else with the remote connection and not the token.
 

simz8

Registered
Feb 17, 2022
4
0
1
Greece
cPanel Access Level
Root Administrator
I am also having the same problem .
i try making a curl call for listing all email accounts, with an API token i've created for one of my cpanel users and i keep getting access denied.
I also tried running the call from the command line of the server itself and i get the same error.
my call is :
curl -H'Authorization: cpanel username:MYTOKEN' 'https://example.com:2083/execute/Email/list_pops'