ym88659208ym87991671
Getting All user devices and Their Functions (get devices) | Documentation SmartMarket
Skip to main content

Getting All user devices and Their Functions (get devices)

Sber Smart Home queries a vendor for a list of all devices linked to the user's account.

Sample case:

  1. A user in the vendor's app ties a new device to their account.
  2. From time to time, Sber Smart Home queries the vendor for the list of all devices of a user.
  3. The vendor returns it. It contains a new device.
  4. Sber Smart Home updates the user's device list. In Salute mobile app, on SberBox, SberPortal and other devices supported with Salute assistants, the new device appears and becomes available for management.

Query format

Sber Smart Home sends a query to the vendor's endpoint. For the headers, see Query headers.

GET /v1/devices

Response format

The vendor sends a response to the Sber Smart Home endpoint. For the headers, see Query headers.

Success response:

FieldTypeMandatory?Description
deviceslist<objects>✔︎Device list (see User device (device))
{
"devices": [
{
"id": string,
"name": string,
"default_name": string,
// ...
},
{
"id": string,
"name": string,
"default_name": string,
// ...
}
]
}

When an error occurs, an object of the Common error (common error) type should be returned:

{
"code": integer,
"message": string,
"details": list<string>
}

Sample query and response

Sber Smart Home queries the vendor for the list of all devices of a user. The vendor returns the list of two devices: a lamp and a socket.

Query:

curl -i -X GET /v1/devices \
-H Host: example.com \
-H Content-Type: application/json \
-H Authorization: Bearer qwerty-1234-... \
-H X-Request-Id: abcd-0000-ifgh-...

Success response:

{
"devices": [
{
"id": "ABCD_003",
"name": "Kitchen socket",
"default_name": "Smart socket"
},
{
"id": "ABCD_005",
"name": "Night-light",
"default_name": "Smart Lamp"
},
]
}

Error response:

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