ym88659208ym87991671
Delete device models (delete models) | Documentation for developers

Delete device models (delete models)

Last updated on December 23, 2022

The vendor sends to Sber Smart Home a list of models that no longer need to be stored in the database: users do not and will not have such devices.

Sample case:

  1. In the past, the vendor added a device model to Sber Smart Home, yet now it is out of production. This model of a device does not and will not be available to users of Sber Smart Home.
  2. The vendor notifies Sber Smart Home of the models that need to be removed.
  3. Sber Smart Home removes such models from its database.

Query format

The vendor sends a notification 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.

DELETE /v1/models

Query body:

FieldTypeMandatory?Description
model_idslist<string>✔︎List of deleted models IDs
{
"model_ids": [
"model1_id": string,
"model2_id": 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

When an error occurs, Sber Smart Home may return:

  • A list of errors that contains error objects. Each object points to specific models with their removal 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 remove some of them, but an error occurs when removing the rest, Sber Smart Home will send an error response containing a list of devices not removed.

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 about the removal of two device models.

Query:

curl -i -X DELETE /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-...
{
"model_ids": [
"QWERTY123",
"QWERTY124"
]
}

Success response:

HTTP/1.1 200 OK

Error response:

{
"errors": [
{
"id": "QWERTY123",
"code": 500,
"error": "System error"
},
{
"id": "QWERTY124",
"code": 500,
"error": "System error"
}
]
}
Sber process cookies only to personalize services according to Cookies Usage Policy. You can prevent the processing of cookies in your browser settings.