Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

API CALL - Return me Status code 529

Hello!

I have XG-210 with SFOS 17.5.15 MR-15 (LAN IP: 10.20.1.254/16)

I have a Linux Test PC (10.20.6.5/16)

I configure System -> Backup & Firmware - >API (Allowed IP Address) with Linux Test PC: 10.20..6.5

I have a "IP list" name "IP-Blacklist" defined in Host and services

I need to add some IP to this list via API Call.

I setup this test-api.xml:

<Request>
        <Login>
                <Username>admin</Username>
                <Password>FwPassword</Password>
        </Login>
        <Set>
                <IPHost>
                        <Name>IP-Blacklist</Name>
                        <HostType>IPList</HostType>
                        <ListOfIPAddresses>192.168.222.125,192.168.222.134</ListOfIPAddresses>
                </IPHost>
        </Set>
</Request>

and when i run the command:

curl -k 10.20.1.254:4444/webconsole/APIController -F "reqxml=<test-api.xml" from Linux Test PC (10.20.6.5), the firewall return me:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Status code="529">Input request file is Invalid</Status>
</Response>

Why??? where am I wrong?

Thanks!



This thread was automatically locked due to age.
Parents Reply Children
  • I guess, you need to specify the type.

    -<IPHost transactionid="">

    <Name>IPListObject</Name>

    <IPFamily>IPv4</IPFamily>

    <HostType>IPList</HostType>

    <ListOfIPAddresses>1.2.3.4,8.8.8.8</ListOfIPAddresses>

    </IPHost>

    Thats a example IP List object, exported via Import/export.

    Try to add the IPFamily Reference. 

  • Hi LuCar!

    from API Documentation IPFamily is not Mandatory (default is IPv4).

    The problem is user!!!

    At the beginning I create an "apiuser" with a password here (see Profile).

    with this profile

    After I gave the "Administrator" profile to the "apiuser"... same thing: ....status code 529.

    Now I Now I've tried with the admin user and SUCCESS!!!!!

    Now the question is, why can't I use users other than "admin"?

  • I found the problem: the password I had generated for the API user contained the character "&" which is not well seen by XML! Triumph 

    I recommend before carrying out curl tests to check the XML file for example with codebeautify.org/xmlvalidator ...

    Bye