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.

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:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    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.
     
  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:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page