• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Important questions regarding the RPC RPI

L

lonnie

Guest
I'm having some issues using PHP and the XML RPC protocol..

I can get a client created and I can add a new domain if I specify all the limits and hosting settings MANUALLY, but what we're trying to accomplish is migrating a bunch of customers from another hosting service to our plesk servers.. We've created domain templates that have our different levels of service defined, these templates match up with the previous hosting environment...

When I specify a "template-id" or "template-name" tag, the XML call goes through without error, but NONE of the template settings are applied at all..

The only thing I'm setting in the vrt_hst block is the ip address and ftp login information, if I supply ANYTHING less I start getting an error saying that the field "login" is blank.

Now to show you some of what I'm sending.. (replacing some of the info with bogus info naturally)

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="1.4.1.1">

<domain>
<add>
<gen_setup>
     <name>test.com</name>
     <client_id>122</client_id>
     <htype>vrt_hst</htype>
     <ip_address>192.168.0.55</ip_address>
</gen_setup>

<hosting>
     <vrt_hst>
        <ftp_login>somelogin</ftp_login>
        <ftp_password>somepassword</ftp_password>
        <ip_address>192.168.0.55</ip_address>
     </vrt_hst>
</hosting>

<template-name>Standard</template-name>

</add>
</domain>
</packet>

When I send this packet, I get the following response

Code:
<packet version="1.4.1.1">
<domain>
<add>
<result>
   <status>ok</status>
   <id>48</id>
</result>
</add>
</domain>
</packet>

Yet, none of the settings contained in the "Standard" template have been set for this new domain account, everything is "unlimited", none of the options are applied whatsoever.. I've tried replacing template-name with template-id and then providing the ID number of the template, this makes no difference.

Can ANYONE help?
 
The code you provided looks ok. I've been battling the Plesk api for about 8 weeks now and have put the templates to rest. After contacting support about templates on numerous occasions, they informed me that functionality for an update or "set" on a template based domain is not possible as of Plesk 8.0. Also, when I performed a "get" request to extract template settings, nothing was returned from plesk - no response. The easiest thing for you may be what I did; just specify all parameters in your xml request when creating the domain. Good luck.
 
Back
Top