• 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.

Plesk API

J

jefwic

Guest
Hi everyone,

I am trying to integration the Plesk API (which uses XML) with some of my PHP scripts. I haven't worked much with XML, however have read through the tutorials on w3schools.com and am still a little stumped. It would be greatly appreciated if someone could help me with this.


Plesk API Documentation lists the schemas that Plesks uses, and I believe this shows how to use the right commands (is this correct?).

I am trying to use this code:

Code:
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="$proto">
<server>
<get>
<permissions/>
</get>
</server>
</packet>
EOF;
(the $data is part of the PHP submitting)

and the returned XML is

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.3.1.0">
  <server>
    <get>
      <result>
        <status>ok</status>
      </result>
    </get>
  </server>
</packet>
(which is the same as if no specific commands are sent)

Code:
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="$proto">
<server>
<get>
<gen_info/>
</get>
</server>
</packet>
EOF;
gets
Code:
  <?xml version="1.0" encoding="UTF-8" ?> 
- <packet version="1.3.1.0">
- <server>
- <get>
- <result>
  <status>ok</status> 
- <gen_info>
  <server_name>TechServer.prod.phx1.secureserver.net</server_name> 
  </gen_info>
  </result>
  </get>
  </server>
  </packet>

I think I'm just a little off in my coding. What I am trying to get is the permissions for a client named "Hosting". If someone knows what I am doing wrong / how to fix it / or where I can learn to do it right it would be great.

Thanks,
Jeff
 
Hi, I have managed to get everything working ! :D

However, one question, how do you get the API to enable Apache ASP? I have tried <asp>true</asp> however this is not enabling it, everything else works fine.

Is it possible I am just doing this wrong - that the <asp> is for asp on a windows server on not Apache ASP?

Thanks,
Jeff

EDIT: After re-checking documentation <asp> is definately for Apache ASP. This is possibly a bug. Anyone else had success/problems with this?
 
You can not set asp using the API. It's a bug that will be fixed in 7.5.4.
 
Thanks. Do you know if it worked in previous versions, such as 7.5.2?

Jeff
 
Back
Top