Updating user devices (put devices)

The vendor posts for Sber Smart Home an up-to-date list of a user's devices.

Sample case:

  1. A user in the vendor application changes a parameter of one or more devices, such as name, firmware version or some other parameter.
  2. The vendor sends to Sber Smart Home a list of devices that have changed.
  3. Sber Smart Home updates devices in Salute mobile app, SberPortal, SberBox and other devices supported with Salute assistants.

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/devices

Query body:

Field Type Mandatory? Description
devices list<object> ✔︎ Device list (see User device (device))
{
    "devices": [
        {
            "id": string,
            "name": string,
            "default_name": string,
            // ...
        },
        {
            "id": string,
            "name": string,
            "default_name": string,
            // ...
        }
    ]
}

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 whose status could not be updated.
  • A common error. that describes the problem as a whole and is returned when the problem cannot be juxtaposed with specific devices.

If a vendor notified of several devices, 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 devices 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 of the user's smart lamp update.

Query:

curl -i -X PUT /v1/devices HTTP/1.1 \
-H Host: example.com \
-H Content-Type: application/json \
-H Authorization: Bearer qwerty-1234-... \
-H X-Request-Id: abcd-0000-ifgh-...
{
    "devices": [
        {
        "id": "ABCD_005",
        "name": "Night light",
        "default_name": "Smart lamp"
        }
    ]
}

Success response:

HTTP/1.1 200 OK

Error response:

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