improved
31 Oct 2023 - Upgraded Get / Set Config APIs
about 1 year ago by Dev Team
The configuration related APIs have been updated starting from Device Model version 1.5.
Returned data has been modified from embedding version
and last_updated
into the configuration object directly. Now the configuration sits inside the object on a side key named config
Return value of Get Config (pre 1.0.5) for versions < 1.0.5:
{
"version": 10,
"last_updated": "2020-01-01T01:01:01.000+00:00",
"network": {
"ip": "192.168....",
"...": "..."
},
"other": {
"data": "..."
}
}
Return value of Get Config for versions >= 1.0.5
{
"name": "My device",
"version": 10,
"last_updated": "2020-01-01T01:01:01.000+00:00",
"config": {
"network": {
"ip": "192.168....",
"...": "..."
},
"other": {
"data": "..."
}
}
}
The device's
name
field has also been added to configuration data. This allows to get notified on device's name changes by monitoring the configuration version.