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.

listfullbackups not found

Discussion in 'cPanel Developers' started by shashank, Jun 10, 2015.

  1. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello People,

    I have created a script which uses cpanel and WHM API functions for common Cpanel operations via a admin backend for a client using PHP. I am trying to use listfullbackups function from the backups module as per

    https://documentation.cpanel.net/display/SDK/cPanel+API+2+Functions+-+Backups::listfullbackups

    but I get the error as :

    Code:
    Could not find function 'listfullbackups' in module 'backups'
    Has anyone run into the issue before ?

    @CpanelDevs any idea on the fix ?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hi,

    Well the code is simple :
    PHP:
    $query "https://$host:2087/xml-api/cpanel?&cpanel_xmlapi_user=$cpuser&cpanel_xmlapi_module=backups&cpanel_xmlapi_func=listfullbackups&cpanel_xamlapi_apiversion=2";

    $curl curl_init();
    curl_setopt($curlCURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($curlCURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($curlCURLOPT_RETURNTRANSFER,1);
    $header[0] = "Authorization: Basic " base64_encode($login.":".$pass) . "\n\r" ;
    curl_setopt($curl,CURLOPT_HTTPHEADER,$header);
    curl_setopt($curlCURLOPT_URL$query);

    $result curl_exec($curl);
    Above is the snippet how I am calling the module. It works perfectly the same way for all other modules and functions like Email, FTP etc.

    Please advice.
     
  4. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hi,

    I don't think that scenario applies on my script. Here is how I am authenticating.

    1. The WHM login and password is either root or the reseller user and password. This can be seen here and works for authentication just fine.
    PHP:
    $header[0] = "Authorization: Basic " base64_encode($login.":".$pass) . "\n\r" ;
    2. The query URL code is as below :
    PHP:
    $query "https://$host:2087/xml-api/cpanel?&cpanel_xmlapi_user=$cpuser&cpanel_xmlapi_module=backups&cpanel_xmlapi_func=listfullbackups&cpanel_xamlapi_apiversion=2";
    You can see I am already using cpanel_xmlapi_user as $cpuser which I am fetching as :
    PHP:
    $cpuser $_GET['user'];
    I am passing it via the URL as http://myurl/file.php?user=mytestuser .

    Also this same logic works for all other modules like Email, FTP etc. Its just the backups module that gives the error.
     
  5. kamall

    kamall Active Member

    Joined:
    Mar 17, 2012
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bethune France
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello
    Can you connect via filezilla on port 22 or not?user and pass same as root.
    Regards
    Kamall;
     
  6. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Could you explain to me how login to port 22 affects cpanel's xml-api when the error message does not show any authentication errors?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    The examples you provided are not following the format listed at:

    Use WHM API to Call cPanel API & UAPI

    For example, this works well when I tested:

    Code:
    https://IP:2087/cpsess123456789/json-api/cpanel?&cpanel?api.version=1&cpanel_jsonapi_user=cptest01&cpanel_jsonapi_module=Backups&cpanel_jsonapi_func=listfullbackups&cpanel_jsonapi_apiversion=2
    Does this help address the issue?

    Thank you.
     
  8. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    To expand on why you are having issues, use "Backups" not "backups"

    Good
    Code:
    /json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Backups&cpanel_jsonapi_func=listfullbackups
    Code:
    {"cpanelresult":{"apiversion":2,"func":"listfullbackups","data":[],"event":{"result":1},"module":"Backups"}}


    Bad
    Code:
    /json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=backups&cpanel_jsonapi_func=listfullbackups
    Code:
    {"cpanelresult":{"apiversion":2,"error":"Could not find function 'listfullbackups' in module 'backups'","func":"listfullbackups","data":{"reason":"Could not find function 'listfullbackups' in module 'backups'","result":0},"module":"backups"}}
     
  9. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hi,

    I had used Backups as the Module as well before but it did not work. However, the issue is solved now. If you check my code above. I was using "cpanel_xamlapi_apiversion" and not "cpanel_xmlapi_apiversion" . I changed to cpanel_xamlapi_apiversion and it started working.
     
Loading...
Similar Threads - listfullbackups found
  1. Ruan
    Replies:
    1
    Views:
    503

Share This Page