ym88659208ym87991671
Deleting user devices (delete devices) | Documentation SmartMarket
Skip to main content

Deleting user devices (delete devices)

The vendor notifies Sber Smart Home that a user has deleted one or more devices.

Sample case:

  1. A user deletes one or more devices in the vendor application.
  2. The vendor notifies Sber Smart Home about the devices removed.
  3. Sber Smart Home updates a list of the user's devices and ceases to display the removed 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.

DELETE /v1/devices

Query Body:

FieldTypeMandatory?Description
device_idlist<string>✔︎List of deleted devices IDs
{
"device_ids": [
"device1_id": string,
"device2_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 devices with their removal unsuccessful.
  • A common error that describes the problem as a whole and is not returned, unless the problem cannot be juxtaposed with specific devices.

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 devices: smart lamp and smart socket.

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-...
{
"device_ids": [
"ABCD_011",
"ABCD_013"
]
}

Success response:

HTTP/1.1 200 OK

Error response:

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