Appendix B: WebAPI
Import Configuration Group
An HTTP POST request can be sent to the device to set configuration.
Protocol: HTTP
Method: Post
URL: http://<hostname>/import/config
Parameters:
configrecord: Content of configuration group in XML format. CURL example (configuration is saved in a local file config.xml):
curl
CURL example (configuration as part of command):
curl
<!DOCTYPE configrecord [
<!ELEMENT configrecord (configgroup+)> <!ELEMENT configgroup (configitem+)> <!ELEMENT configitem (value+)> <!ELEMENT value (#PCDATA)>
<!ATTLIST configrecord version CDATA #IMPLIED> <!ATTLIST configgroup name CDATA #IMPLIED> <!ATTLIST configgroup instance CDATA #IMPLIED> <!ATTLIST configitem name CDATA #IMPLIED> <!ATTLIST configitem instance CDATA #IMPLIED> <!ATTLIST value name CDATA #IMPLIED>
]>
<configrecord version = "0.1.0.1">
<configgroup name = "Access Point" instance = "ap0"> <configitem name = "SSID">
<value>MY DEVICE</value> </configitem>
</configgroup>
</configrecord>'
HTTP example:
<form method="post"
<input name="configrecord" type="file" size="32">
<input name="submit" type="submit" value="Import Configuration"> </form>
xPico® | 102 |