The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error calling functions using web interface

Discussion in 'cPanel Developers' started by GamingX, Jun 12, 2013.

  1. GamingX

    GamingX Member

    Joined:
    Feb 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. GamingX

    GamingX Member

    Joined:
    Feb 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Thank you!
     
Loading...

Share This Page