Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Calling the cPanel API 2 as end-user

Discussion in 'cPanel Developers' started by cascer1, Jun 24, 2015.

  1. cascer1

    cascer1 Registered

    Joined:
    Mar 26, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm working on a little application to help customers manage their accounts from their phone (based on an app that was offered me for $1000/year..).

    I figured it would be safest to not have the root login in the source code (I know it's compiled and all, but people always figure out how to decompile something) and so I wanted to call the API as a regular user.

    Unfortunately, I always get the following error when trying to perform any call as user:
    <error>Execution of <function> is not permitted inside of webmail (api2)</error>

    How would I go about calling the API as a regular cPanel user?

    Thank you,
    Cas
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    This document should help:

    Guide to API Authentication

    Also, make sure you are connecting to the cPanel port (2082, 2083) and not a webmail port (2095,2096).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cascer1

    cascer1 Registered

    Joined:
    Mar 26, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    I was indeed able to resolve the issue. I was 100% sure that I used 2083 as port but it turns out I did enter 2096.
    Everything's working fine now :)

    Thank you.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice