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

API Calls don't work since upgrade to 2.2

Discussion in 'Plesk Expand 2.2 Troubleshooting Issues' started by tdolloff, Oct 10, 2007.

  1. tdolloff

    tdolloff Guest

    I've been using the plesk api for some account automation for over a year and they have been working fine until we upgraded to version 2.2 yesterday. Now all of my requests just get a response of "400 - bad request".

    Here is a sample of one of my requests:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <packet version="">
    <cname>John Doe</cname>
    <pcode>60031 </pcode>

    The header contains the following information:
    HTTP_AUTH_LOGIN: (login)
    HTTP_AUTH_PASSWD: (password)
    HTTP_AUTH_OP: exp_plesk_client
    Content-Type: text/xml

    And I get the following information returned:
    REPLY_TYPE=HTTP/1.0 400 Bad Request

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <title>400 - Bad Request</title>
    <h1>400 - Bad Request</h1>

    The only thing that I've changed in the API call is the packet version (to match what the expand GUI interface shows as the action taken).

    Any help troubleshooting this issue would be greatly appreciated.
  2. girin

    girin Guest


    maybe I`m wrong, but seems you have misprint in your XML:

    <?xml version="1.0"? encoding="UTF-8" standalone="no"?>
  3. tdolloff

    tdolloff Guest

    Thanks for looking at it, but...

    That was unfortunately a stupid cut and paste error into the forum, but my actual code doesn't have that misplaced question mark there so that's not the cause of the problem.
  4. girin

    girin Guest

  5. tdolloff

    tdolloff Guest

    Unfortunately, there is no action error file being created in /usr/local/expand/var/log/action/ by the api call. There is no Expand action ID being returned by the http request either. It appears to be a generic http Bad Request. It's like the Expand API is never even receiving it. I'm assuming there was something wrong with the install so that the http requests aren't even getting to webgate.php.
  6. Sergey L

    Sergey L Golden Pleskian Staff Member

    Aug 10, 2006
    Likes Received:
  7. tdolloff

    tdolloff Guest

    Yes, the perl sample in the updated integration guide fixes my problem. Unfortunately, I had to pay for per-incident support from Plesk to get a resolution on this. The difference is caused apparently because the Expand 2.2 API now uses lighttpd instead of Apache httpd which handles the http request differently.