ym88659208ym87991671
Get a list of device models (get models) | Documentation for developers

Get a list of device models (get models)

Last updated on May 25, 2023

The vendor queries for a list of the his device models.

Sample case:

  1. The vendor checks which models of his devices are in the smart home database, and which ones are not. To do this, sends a request to the smart home.
  2. Sber Smart Home returns a list of device models and their functions.

Query format

The vendor sends a query to Sber Smart Home endpoint: https://partners.iot.sberdevices.ru/. Please note that in order to access the Sber cloud, Russian certificates must be installed on vendor's server.

For the headers, see Query headers.

GET /v1/models

Response format

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

Success response:

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": [
string,
string,
// ...
],
"dependencies": {
"func_name": {
"key": string,
"value": [
{
"type": string,
"type_value": object
},
{
// ...
}
]
}
},
"allowed_values": {
"func_name": {
"type": string,
"type_values": {
"min": object,
"max": object,
"step": object
},
},
{
// ...
}
}
},
{
// ...
}
]
}

If an error occurs, you must return an object of the Common error (common error) type:

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

Sample query and response

The vendor requests a list of models of his devices from the Sber Smart home. The smart home returns one model – a lamp model.

Query:

curl -i -X GET /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-...

Success response:

{
"models": [
{
"id": "QWERTY123",
"manufacturer": "Xiaqara",
"model": "SM0123456789",
"hw_version": "3.2",
"sw_version": "5.7",
"description": "Smart bulb Xiaqara",
"category": "light",
"features": [
"online",
"on_off",
"light_mode",
"light_brightness",
"light_colour",
"light_colour_temp",
"sleep_timer"
],
"dependencies": {
"light_colour": {
"key": "light_mode",
"value": [
{
"type": "ENUM",
"enum_value": "colour"
}
]
}
},
"allowed_values": {
"light_brightness": {
"type": "INTEGER",
"integer_values": {
"min": "10",
"max": "900",
"step": "1"
}
}
}
}
]
}

Error response:

{
"code": 500,
"message": "Internal server error",
"details": []
}
Sber process cookies only to personalize services according to Cookies Usage Policy. You can prevent the processing of cookies in your browser settings.