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

    0
     
    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="2.2.1.27">
    <add_use_template>
    <gen_info>
    <cname>John Doe</cname>
    <pname>w30494</pname>
    <login>w30494</login>
    <passwd>jiZi23O7z</passwd>
    <phone></phone>
    <fax></fax>
    <email></email>
    <address></address>
    <city></city>
    <state>IL</state>
    <pcode>60031 </pcode>
    <country>US</country>
    <status>0</status>
    </gen_info>
    <tmpl_id>1</tmpl_id>
    <server_auto>
    <optimal>1</optimal>
    <group_id>3</group_id>
    </server_auto>
    <server_os>Windows</server_os>
    </add_use_template>
    </packet>

    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

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

    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

    0
     
    Hi,

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

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

    tdolloff Guest

    0
     
    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

    0
     
  5. tdolloff

    tdolloff Guest

    0
     
    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

    32
    43%
    Joined:
    Aug 10, 2006
    Messages:
    1,195
    Likes Received:
    30
  7. tdolloff

    tdolloff Guest

    0
     
    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.
     
Loading...