Posting device models (post models)

The vendor adds a new device model to the database of Sber Smart Home.

Sample case:

  1. The vendor has started to produce or sell a new device model in Russia: a light bulb, a socket or other goods.
  2. The vendor notifies Sber Smart Home about the new model.
  3. Smart Home Sber adds the new device model to its base.

Query format

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

POST /v1/models

Query body:

Field Type Mandatory? Description
models list<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, Sber Smart Home may return:

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

If a vendor notified of several devices, and Sber Smart Home has managed to post some of them, but an error occurs when posting the rest, Sber Smart Home will send an error response containing a list of devices not posted.

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 added.

Query:

curl -i -X POST /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"
        }
    ]
}