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!

Change "editquota" email does not work ($xmlapi->api2_query) -- HELP

Discussion in 'cPanel Developers' started by conseld, Jun 19, 2014.

  1. conseld

    conseld Member

    Joined:
    Feb 16, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    Hello guys, I do not understand where I am going wrong, because to enter, list, remove, change password works. I'm using the module "api2_query" using this API -> https://github.com/CpanelInc/xmlapi-php

    Change "editquota" email does not work, even searched here in the forum I had no answer.

    Below and script "$ xmlapi-> api2_query" I believe what I'm using is right. Could anyone help me where I am going wrong, what is missing? I will be very grateful for someone to help me.

    Email Module Documentation
    Email Module Documentation
    Code:
    Email::editquota 
    
    [B]$qt = array(domain=>'domain.com', email=>'doteste1@domain.com', quota=>'12');
    $result = $xmlapi->api2_query($userLogin, "Email", "editquota", $qt);
    print_r($result);[/B]
    
    // XML return below
    
    <?xml version="1.0" ?>
      <cpanelresult>
        <apiversion>2</apiversion>
        <data>
          <reason>Account does not exist.</reason>
          <result>0</result>
        </data>
        <error>Account does not exist.</error>
        <event>
          <result>1</result>
        </event>
        <func>editquota</func>
        <module>Email</module>
      </cpanelresult>
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    834
    Likes Received:
    29
    Trophy Points:
    178
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    From first glance, you're using an api2 call, when in fact this is an api1 function:

    Email Module Documentation


    Try using an API1 call instead.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. conseld

    conseld Member

    Joined:
    Feb 16, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    Hello thanks for the reply, but I have done with this API1, and that? as shown below. I tried and I still error.

    Code:
    $qt = array(domain=>'domain.com', email=>'doteste1@domain.com', quota=>'12');
    $result = $xmlapi->api1_query($userLogin, "Email", "editquota", $qt);
    print_r($result);
    
    // XML return below
    
    <?xml version="1.0" ?>
    <cpanelresult>
           <module>Email</module>
           <func>editquota</func>
           <type>event</type>
           <source>internal</source>
          <apiversion>1</apiversion>
          <data>
              <result>&lt;br /&gt;&lt;font color=&quot;#FF0000&quot;&gt;Account does not exist.&lt;/font&gt;</result>
           </data>  
       <event>
        <result>1</result>
      </event>
    <error>Account does not exist.</error></cpanelresult>
     
  4. conseld

    conseld Member

    Joined:
    Feb 16, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151

    Thanks for the response, since the ultilizei API1 and keeps giving error, what is missing? Could you help me?
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,183
    Likes Received:
    1,936
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Upon reviewing your script, I noticed the following:

    Code:
    $qt = array(domain=>'domain.com', email=>'doteste1@domain.com', quota=>'12');
    The entry for email should not include the @domain.com suffix. Instead, in your example, it should only use "doteste1".

    Thank you.
     
    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