• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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