Error calling functions using web interface

GamingX

Member
Feb 9, 2010
6
0
51
Hello guys,

I am trying to implement a couple of things by using some of the APIs provided by cPanel, however I decided to check if they worked using the web interface by calling the functions using the URL. I tried using the following function to get a user's account data using his domain,

https://example.net:2087/json-api/domainuserdata?domain=example.com

But I'm getting the following error:

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

To ensure that it wasn't a problem with the permissions, I used the root account to call the function but I get the same thing there as well.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

You should login to Web Host Manager before entering that URL directly in your browser. This should result in a particular session, so the URL ends up looking like this if you input it manually:

Code:
https://vps.example.com:2087/cpsess7796639526/json-api/domainuserdata?domain=cptest01.com
Thank you.
 

GamingX

Member
Feb 9, 2010
6
0
51
Hello :)

You should login to Web Host Manager before entering that URL directly in your browser. This should result in a particular session, so the URL ends up looking like this if you input it manually:

Code:
https://vps.example.com:2087/cpsess7796639526/json-api/domainuserdata?domain=cptest01.com
Thank you.
Thank you!