• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue plesk api add new domain

SanDisk

New Pleskian
hello, my customer asked me to create simple script for add new domain in plesk panel with api, im created this code : [Python] import requests import ssl ssl._create_default_https_context = ssl._create_unv - Pastebin.com

'''

PHP:
<?xml version='1.0' encoding='UTF-8' ?><packet version='1.5.0.0'>
    <domain>
    <add>
      <gen_setup>
         <name>google.com</name>
         <client_id>1</client_id>
         <ip_address>127.0.0.1</ip_address>
         <status>0</status>
      </gen_setup>
      <hosting>
         <vrt_hst>
             <ftp_login>dsakdakd</ftp_login>
             <ftp_password>sdffsdfsdfsddfs</ftp_password>
             <php>true</php>
             <ssi>true</ssi>
             <cgi>true</cgi>
             <php_safe_mode>false</php_safe_mode>
             <ip_address>127.0.0.01</ip_address>
         </vrt_hst>
      </hosting>
    </add>
    </domain>
    </packet>
'''

return :

Code:
<?xml version="1.0"?>
        <packet version="1.5.0.0">
                <system>
                        <status>error</status>
                        <errcode>1014</errcode>
                        <errtext>Parser error: Request is invalid</errtext>
                </system>               <output>
                &lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  DOMDocument::schemaValidate() [&lt;a href='domdocum
ent.schemavalidate'&gt;domdocument.schemavalidate&lt;/a&gt;]: Element 'ftp_login
': This element is not expected. Expected is ( property ). in &lt;b&gt;C:\Progra
m Files (x86)\Parallels\Plesk\admin\plib\api-rpc\ExpandXMLLib.php&lt;/b&gt; on l
ine &lt;b&gt;56&lt;/b&gt;&lt;br /&gt;

                </output>       </packet>
where im wrong ?
 
It should be with <property> operator, like

Code:
<vrt_hst>
   <property>
       <name>ftp_login</name>
       <value>mylogin</value>
   </property>
   <property>
       <name>ftp_password</name>
       <value>mypassword</value>
   </property>
   <ip_address>123.123.123.123</ip_address>
   <ip_address>2002:5bcc:18fd:c:123:123:123:123</ip_address>
</vrt_hst>
 
Code:
<?xml version="1.0"?>
        <packet version="1.5.0.0">
                <system>
                        <status>error</status>
                        <errcode>1014</errcode>
                        <errtext>Parser error: Request is invalid</errtext>
                </system>               <output>
                &lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  DOMDocument::schemaValidate() [&lt;a href='domdocum
ent.schemavalidate'&gt;domdocument.schemavalidate&lt;/a&gt;]: Element 'ftp_login
': This element is not expected. Expected is ( property ). in &lt;b&gt;C:\Progra
m Files (x86)\Parallels\Plesk\admin\plib\api-rpc\ExpandXMLLib.php&lt;/b&gt; on l
ine &lt;b&gt;56&lt;/b&gt;&lt;br /&gt;

                </output>       </packet>
same error
 
Code:
<packet version='1.5.0.0'>
        <domain>
        <add>
          <gen_setup>
             <name>google.com</name>
             <client_id>1</client_id>
             <ip_address>10.58.108.100</ip_address>
             <status>0</status>
          </gen_setup>
          <hosting>
             <vrt_hst>
             <property>
                <name>ftp_login</name>
                <value>mylogin</value>
            </property>
            <property>
                <name>ftp_password</name>
                <value>mypassword</value>
            </property>
                 <ip_address>10.58.108.100</ip_address>
             </vrt_hst>
          </hosting>
        </add>
        </domain>
        </packet>

This works fine for me.
 
Back
Top