1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Creating email account via API

Discussion in 'Plesk 11.x for Linux' started by Anthony1, Nov 13, 2012.

  1. Anthony1

    Anthony1 New Pleskian

    10
    35%
    Joined:
    Nov 13, 2012
    Messages:
    5
    Likes Received:
    0
    Hi,
    I'm having trouble on how to create an email account using the Plesk API. The XML sent to the server is :
    According to the documentation, this should work, but I get this error instead : Parser error: Request is invalid. Error in line 10: Element 'password': This element is not expected.

    I guess I could create the account without any password, then add it via the update action, but this requires more treatment in case of failure (if the password is not strong enough, adding it will fail and I'll have to remove the created address).

    Any help will be appreciated. Thanks.
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,564
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
  3. SibProgrammer

    SibProgrammer Regular Pleskian Staff Member

    29
     
    Joined:
    Nov 21, 2004
    Messages:
    342
    Likes Received:
    15
    The order of elements has matter.

    Here is the fixed request:

    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.3.5">
    <mail>
    <create>
    <filter>
    <site-id>8</site-id>
    <mailname>
    <name>maxime2</name>
    <password>
    <value>test</value>
    <type>plain</type>
    </password>
    <antivir>inout</antivir>
    </mailname>
    </filter>
    </create>
    </mail>
    </packet>
     
  4. Anthony1

    Anthony1 New Pleskian

    10
    35%
    Joined:
    Nov 13, 2012
    Messages:
    5
    Likes Received:
    0
    I must have missed the part of the documentation where it's specified to put elements in the right order. It works fine now. Thanks !
     
  5. RishabhK

    RishabhK New Pleskian

    6
     
    Joined:
    Apr 30, 2014
    Messages:
    1
    Likes Received:
    0
    Is it possible to create an email id through plesk panel with the help of any API?

    " I just want know that i have VPS with plesk panel and i want to facilitate user to create an email id with the domain hosted on this server. I want to provide them the functionality like Gmail or yahoo so that they can create email id without logged into the plesk panel. Please advise on this."
     
Loading...