Getting User Info (get user)

Sber Smart Home queries the vendor for a user ID in the vendor's system. It is used in the following case:

  1. In Salute mobile app, a user links their Sber ID and their vendor account.
  2. Sber Smart Home sends a query together with the user token, for the user ID in the vendor's system.
  3. The vendor returns the user ID.

Query format

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

GET /v1/user

Response format

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

Success response:

Field Type Mandatory? Description
id string ✔︎ User ID in the vendor’s system
{
    "id": 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 a user ID in the vendor's system.

Query:

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

Success response:

{
    "id": "AB12345"
}

Error response:

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