• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Setting up domains via API

J

Jamesman

Guest
I am having issues creating new domains on Plesk 9.5.2

I can create domains with minimal settings but once I try to add the <user> section I get this error:

error 1014 Parser error: Request is invalid

I have tried several configurations but none work where I can sett all the extra settings.

Any thing wrong with this packet?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.4.2.0">
<domain>
<add>
   <gen_setup>
      <name>example.com</name>
      <client_id>1</client_id>
      <htype>vrt_hst</htype>
      <ip_address>xxx.xxx.xxx.xxx</ip_address>
      <status>0</status>
   </gen_setup>
  <hosting>
     <vrt_hst>
         <ftp_login>example</ftp_login>
         <ftp_password>qweqwe</ftp_password>
         <ip_address>xxx.xxx.xxx.xxx</ip_address>
      </vrt_hst>
   </hosting>   
   <user>
      <enabled>true</enabled>
      <password>qweqwe</password>
      <cname>Mega Company</cname>
      <pname>John Doe</pname>
      <phone>2121342526</phone>
      <fax>2121342527</fax>
      <email>[email protected]</email>
      <address>Gray Lake Road, 12</address>
      <city>Naples</city>
      <state>FL</state>
      <pcode>34203</pcode>
      <country>US</country>
      <multiply_login>true</multiply_login>
      <permissions>
          <manage_quota>false</manage_quota>
          <manage_subdomains>false</manage_subdomains>
          <manage_anonftp>false</manage_anonftp>
          <manage_webapps>false</manage_webapps>
          <manage_maillists>false</manage_maillists>
          <make_dumps>true</make_dumps>
          <manage_ftp_password>true</manage_ftp_password>
          <manage_performance>true</manage_performance>
          <manage_domain_aliases>false</manage_domain_aliases>
          <dashboard>true</dashboard>
          <manage_dashboard>true</manage_dashboard>
          <manage_subftp>false</manage_subftp>
          <allow_ftp_backups>true</allow_ftp_backups>
      </permissions>
   </user>
   <prefs>
	<www>true</www>
   </prefs>
   <template-name>Standard Plan</template-name>
</add>
</domain>
</packet>
 
I tried without the permissions set and it still gave me the same error.

All the user tags are optional so I tried with just

Code:
   <user>
     <enabled>true</enabled>
   </user>

Same error. But once I remove the <user> set it works.
 
Developers have informed me that the documentation example is wrong. The text correctly specifies the the node name is perms. Bug has been submitted.
Also, <user> must follow after <prefs> - the order is strictly fixed.
You can use the following command to validate request XML

$ xmllint --schema /usr/local/psa/admin/htdocs/schemas/rpc/1.4.2.0/agent_input.xsd myrequest.xml
 
Back
Top