ym88659208ym87991671
Updating device models (put models) | Documentation SmartMarket
Skip to main content

Updating device models (put models)

The vendor sends to Sber Smart Home an up-to-date information about the vendor’s device models.

Sample case:

  1. The vendor has changed the specifications of a device model. For example, all devices now have a new version of the firmware.
  2. The vendor notifies Sber Smart Home of a change in a user's device model.
  3. Sber Smart Home updates the model information in its database.

Query format

The vendor sends a notification to Sber Smart Home endpoint: https://partners.iot.sberdevices.ru/. For the headers, see Query headers.

PUT /v1/models

Query body:

FieldTypeMandatory?Description
modelslist<object>✔︎List of device models (see Device model (model))
{
"models": [
{
"id": string,
"manufacturer": string,
"model": string,
"hw_version": string,
"sw_version": string,
"description": string,
"category": string,
"features": [
"online": string,
"on_off": string
// ...
],
"dependencies": {
"func_name": {
"key": "string",
"values": [
{
"type": string,
"type_value": object
},
{
// ...
},
]
},
{
// ...
}
}
},
{
// ...
}
]
}

Response format

Sber Smart Home sends a response to the vendor's endpoint. For the headers, see Query headers.

Success response:

HTTP/1.1 200 OK

If an error occurs, the endpoint may return:

  • A list of errors containing error objects. Each object points to specific models with their updating unsuccessful.
  • A common error. that describes the problem as a whole and is returned when the problem cannot be juxtaposed with specific models.

If the vendor notified of several models, and Sber Smart Home has managed to update some of them, but an error occurs when updating the rest, Sber Smart Home will send an error response containing a list of models not updated.

Device-specific error:

{
"errors": [
{
"id": string,
"code": integer,
"message": string
}
]
}

Common error:

{
"code": integer,
"message": string,
"details": list<string>
}

Sample query and response

The vendor notifies Sber Smart Home that a model of smart socket has been updated.

Query:

curl -i -X PUT /v1/models HTTP/1.1 \
-H Host: example.com \
-H Content-Type: application/json \
-H Authorization: Bearer qwerty-1234-... \
-H X-Request-Id: abcd-0000-ifgh-...
{
"models": [
{
"id": "QWERTY123",
"manufacturer": "Factory",
"model": "SM0123456789",
"hw_version": "3.2",
"sw_version": "5.7",
"description": "About device",
"category": "socket",
"features": [
"online",
"on_off"
]
}
]
}

Success response:

HTTP/1.1 200 OK

Error response:

{
"errors": [
{
"id": "QWERTY123",
"code": 500,
"message": "System error"
}
]
}