Response

All requests will be replied to with a JSON or XML string containing the documented variables for each method.

All JSON responses will contain a dictionary with four keys while XML will contain four elements under the root.

Key Description
status String containing one of ok, warn, fail.
method String containing the name of the method that was called.
result List of response numbers, strings or response dictionaries.
error List of error strings, describing any errors if status is set to warn or fail.

The contents of result will depend on the method called.

Examples for a color search call

JSON

{
    "count": "2",
    "status": "ok",
    "error": [],
    "method": "color_search",
    "result": [
        {
            "score": 100,
            "filepath": "path/folder/match1.jpg"
        },
        {
            "score": 65.7,
            "filepath": "path/folder/match2.jpg"
        }
    ]
}

XML

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <count>2</count>
    <error/>
    <method>color_search</method>
    <result>
        <item>
            <filepath>path/folder/match1.jpg</filepath>
            <score>100.0</score>
        </item>
        <item>
            <filepath>path/folder/match2.jpg</filepath>
            <score>65.7</score>
        </item>
    </result>
    <status>ok</status>
</data>