Retrieves information about a user, the result is only limited to what the callee has access to view. It supports Fields Query Parameter with the userRooms
field, that returns the rooms that the user is part of. The rooms
field returns the unread
property and this field is variable, based on the setting Unread_Count
(Admin Panel
=> General
=> Unread_Count
), this setting provides the ability to choose between options to count the unread messages.
URL | Requires Auth | HTTP Method |
|
|
|
Argument | Example | Required | Description |
|
| Required | The id or username of the user. |
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \-H "X-User-Id: aobEdbYhXfu5hkeqG" \http://localhost:3000/api/v1/users.info?userId=BsNr28znDkG8aeo7W
{"user": {"_id": "nSYqWzZ4GsKTX4dyK","type": "user","status": "offline","active": true,"name": "Example User","utcOffset": 0,"username": "example","avatarETag": "thwftThP3Band942S",},"success": true}
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \-H "X-User-Id: aobEdbYhXfu5hkeqG" \http://localhost:3000/api/v1/users.info?userId=BsNr28znDkG8aeo7W&fields={"userRooms": 1}
{"user": {"_id": "nSYqWzZ4GsKTX4dyK","createdAt": "2016-12-07T15:47:46.861Z","services": {"password": {"bcrypt": ...},"email": {"verificationTokens": [{"token": "...","address": "example@example.com","when": "2016-12-07T15:47:46.930Z"}]},"resume": {"loginTokens": [{"when": "2016-12-07T15:47:47.334Z","hashedToken": "..."}]}},"emails": [{"address": "example@example.com","verified": true}],"type": "user","status": "offline","active": true,"roles": ["user"],"name": "Example User","lastLogin": "2016-12-08T00:22:15.167Z","statusConnection": "offline","utcOffset": 0,"username": "example","avatarETag": "thwftThP3Band942S","rooms": [{"_id": "PoffwDEebAwcmS5A8","rid": "GENERAL","name": "general","t": "c","unread": 1},{"_id": "hr93s8GcJedZbkeaH","rid": "oaqXoFLru3YLuau2J","name": "test","t": "c","unread": 1,"roles": ["owner"]}]},"success": true}
Version | Description |
3.4.0 | Added |
0.70.0 | Added |
0.49.0 | Updated to support |
0.48.0 | Renamed to |
0.35.0 | Added as |