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.

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:
    1
    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:
    817
    Likes Received:
    22
    Trophy Points:
    18
    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.
     
  3. conseld

    conseld Member

    Joined:
    Feb 16, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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:
    1

    Thanks for the response, since the ultilizei API1 and keeps giving error, what is missing? Could you help me?
     
  5. 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 :)

    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.
     
Loading...

Share This Page