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.

How to log into cPanel with PHP for api1

Discussion in 'cPanel Developers' started by chrismec, Nov 5, 2011.

  1. chrismec

    chrismec Registered

    Joined:
    Nov 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello, complete dumb dumb here with cPanel api's and PHP. I need to add and remove email forwarders via cPanel api1. I understand that I will use the following to access the api:

    HTML:
    <cpanel Module="function( params )"> 
    But I need to login to cPanel before I can access the api and I have no idea how to do this.
    I don't have an ssl certificate yet and all the documentation I can find for logging in looks
    like it needs to be secure. I totally understand why, but for right now I dont care. Can
    anyone point me in the right direction for logging in with PHP without authentication?

    Thanks for your time!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You could call this API via the XML API, which you authenticate into in your script using the login credentials of either a reseller that owns that account or a root-level WHM user. There's sample PHP code for accessing API1 and API2 via the XML API at cPanel & WHM's SDK
     
  3. BlaineM.

    BlaineM. cPanel QA Analyst
    Staff Member

    Joined:
    Apr 4, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hey chrismec,

    If you could explain exactly what you're wanting to do with your script, I'd be happy to give you a recommendation. I'd just like to make sure you're wanting what I think you're wanting ;)
     
Loading...

Share This Page