1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Plesk API

Discussion in 'Plesk for Linux - 8.x and Older' started by jefwic, Aug 12, 2005.

  1. jefwic

    jefwic Guest

    0
     
    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
     
  2. jefwic

    jefwic Guest

    0
     
    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?
     
  3. hardweb

    hardweb Guest

    0
     
    You can not set asp using the API. It's a bug that will be fixed in 7.5.4.
     
  4. jefwic

    jefwic Guest

    0
     
    Thanks. Do you know if it worked in previous versions, such as 7.5.2?

    Jeff
     
  5. Griffith

    Griffith Guest

    0
     
    Could you please post how you got it working? :)
     
Loading...