API example communication using XML


Note: They are authenticated for our test database and does not work to test with.

Misc notes

{ "array" : [{...}, {...}] }

...would be...
<array>
    <item>{...}</item>
    <item>{...}</item>
</array>


Booleans will use the strings true and false in XML but be of boolean datatype in JSON.

The request


Note that commands_json is called commands_xml but that it otherwise looks the same. Commands_hash is the checksum for commands_xml (before it's escaped).

<?xml version="1.0" encoding="utf-16"?>
<pond5_api_request>
    <api_key>2_238693674</api_key>
    <ver>1</ver>
    <commands_xml>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;commands&gt;&lt;item&gt;&lt;command&gt;search&lt;/command&gt;&lt;bm&gt;63&lt;/bm&gt;&lt;p&gt;0&lt;/p&gt;&lt;query&gt;dog&lt;/query&gt;&lt;col&gt;7&lt;/col&gt;&lt;/item&gt;&lt;/commands&gt;</commands_xml>
    <commands_hash>ba2868b6924dc54b942065044909e3b5</commands_hash>
</pond5_api_request>


How the commands_xml string looked before escaped + pretty printed
<?xml version="1.0" encoding="UTF-8"?>
<commands>
    <item>
        <command>search</command>
        <bm>63</bm>
        <p>0</p>
        <query>dog</query>
        <col>7</col>
    </item>
</commands>


The response



<?xml  version="1.0" encoding="utf-16"?>
<pond5_api_response>
    <e>false</e>
    <commands>
        <item>
            <tot_nbr_rows>1</tot_nbr_rows>
            <nbr_footage>0</nbr_footage>
            <nbr_music>1</nbr_music>
            <nbr_sfx>0</nbr_sfx>
            <icon_base>http://127.0.0.1/pretendcdn/</icon_base>
            <flv_base>http://d36cfktgcezzxd.cloudfront.net/</flv_base>
            <items>
                <item>
                    <id>128</id>
                    <vs>100</vs>
                    <ox>16</ox>
                    <oy>9</oy>
                    <ar>4</ar>
                    <n>dog</n>
                    <dur>30569</dur>
                    <kw>cool, dark cheerful/happy, snorkråka banan1, banan2, banan3, banan4, banan5, banan6, banan7, banan8, banan9, banan10, banan11, banan12, banan13, banan14, banan15, banan16, banan17, banan18, banan19, banan20, banan21, banan22, banan23</kw>
                </item>
            </items>
        </item>
    </commands>
</pond5_api_response>