Use of the api
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
-
Hey there! As a test, can you run this on the command line of the server to ensure that your token is working properly? 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.0 -
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' ' 0 -
@simz8 - if the issue is happening even from the command line of the same server, that sounds like a problem with the token. Can you try creating a new token and using that for testing and seeing if you get the same issue? 0
Please sign in to leave a comment.
Comments
3 comments