• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Add client issue with API (Using PHP)

D

Dr_Zaius

Guest
Hi all, I have a reseller account for Plesk Panel and I am trying to automate client creation, on submitting the XML I get the error code "1014" with the error message "Error while scaning: Can not navigate to the specified node/offset", the code does not return an error (or work obviosuly) if I comment out the line "$client->appendChild($add);".

The code is as follows:
$xmldoc = new DomDocument('1.0', 'UTF-8');

$xmldoc->formatOutput = true;



// <packet>

$packet = $xmldoc->createElement('packet');

$packet->setAttribute('version', '1.4.1.2');

$xmldoc->appendChild($packet);



// <packet/client>

$client = $xmldoc->createElement('client');

$packet->appendChild($client);



// <packet/client/add>

$add = $xmldoc->createElement('add');

$client->appendChild($add);



// <packet/client/add/geninfo>

$geninfo = $xmldoc->createElement('geninfo');

$add->appendChild($geninfo);



// create child element

$cname = $xmldoc->createElement("cname");

$geninfo->appendChild($cname);



// create text node

$text = $xmldoc->createTextNode("test company");

$cname->appendChild($text);



// create child element

$pname = $xmldoc->createElement("pname");

$geninfo->appendChild($pname);



// create text node

$text = $xmldoc->createTextNode("test name");

$pname->appendChild($text);



// create child element

$login = $xmldoc->createElement("login");

$geninfo->appendChild($login);



// create text node

$text = $xmldoc->createTextNode("testlogin");

$login->appendChild($text);



// create child element

$passwd = $xmldoc->createElement("passwd");

$geninfo->appendChild($passwd);



// create text node

$text = $xmldoc->createTextNode("testpass");

$login->appendChild($text);



// create child element

$status = $xmldoc->createElement("status");

$geninfo->appendChild($status);



// create text node

$text = $xmldoc->createTextNode("0");

$login->appendChild($text);



// create child element

$phone = $xmldoc->createElement("phone");

$geninfo->appendChild($phone);



// create text node

$text = $xmldoc->createTextNode("0123456789");

$phone->appendChild($text);




// <packet/client/add/template-name>

$templatename = $xmldoc->createElement('template-name');

$add->appendChild($templatename);



// create text node

$text = $xmldoc->createTextNode("Unlimited Plan");

$templatename->appendChild($text);

Can anyone advise where I am going wrong here?
 
Back
Top