ym88659208ym87991671
Getting device models (get models) | Documentation SmartMarket
Skip to main content

Getting device models (get models)

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/. 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": [
"online": string,
"on_off": string
// ...
],
"dependencies": {
"func_name": {
"key": "string",
"values": [
{
"type": string,
"type_value": 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 device – a lamp.

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": "Factory",
"model": "SM0123456789",
"hw_version": "3.2",
"sw_version": "5.7",
"description": "About device",
"category": "light",
"features": [
"online",
"on_off"
]
}
]
}

Error response:

{
"code": 400,
"message": "Invalid argument",
"details": []
}