Fuselage
Powered By GitBook
Get User's Info
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
/api/v1/users.info
yes
GET

Query Parameters

Argument
Example
Required
Description
userId or username
BsNr28znDkG8aeo7W
Required
The id or username of the user.

Other Users Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
http://localhost:3000/api/v1/users.info?userId=BsNr28znDkG8aeo7W
Copied!

Example Result Regular User Callee

1
{
2
"user": {
3
"_id": "nSYqWzZ4GsKTX4dyK",
4
"type": "user",
5
"status": "offline",
6
"active": true,
7
"name": "Example User",
8
"utcOffset": 0,
9
"username": "example",
10
"avatarETag": "thwftThP3Band942S",
11
},
12
"success": true
13
}
Copied!

Example Result Admin Callee that requests user's rooms

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
http://localhost:3000/api/v1/users.info?userId=BsNr28znDkG8aeo7W&fields={"userRooms": 1}
Copied!
1
{
2
"user": {
3
"_id": "nSYqWzZ4GsKTX4dyK",
4
"createdAt": "2016-12-07T15:47:46.861Z",
5
"services": {
6
"password": {
7
"bcrypt": ...
8
},
9
"email": {
10
"verificationTokens": [
11
{
12
"token": "...",
13
"address": "[email protected]",
14
"when": "2016-12-07T15:47:46.930Z"
15
}
16
]
17
},
18
"resume": {
19
"loginTokens": [
20
{
21
"when": "2016-12-07T15:47:47.334Z",
22
"hashedToken": "..."
23
}
24
]
25
}
26
},
27
"emails": [
28
{
29
"address": "[email protected]",
30
"verified": true
31
}
32
],
33
"type": "user",
34
"status": "offline",
35
"active": true,
36
"roles": [
37
"user"
38
],
39
"name": "Example User",
40
"lastLogin": "2016-12-08T00:22:15.167Z",
41
"statusConnection": "offline",
42
"utcOffset": 0,
43
"username": "example",
44
"avatarETag": "thwftThP3Band942S",
45
"rooms": [
46
{
47
"_id": "PoffwDEebAwcmS5A8",
48
"rid": "GENERAL",
49
"name": "general",
50
"t": "c",
51
"unread": 1
52
},
53
{
54
"_id": "hr93s8GcJedZbkeaH",
55
"rid": "oaqXoFLru3YLuau2J",
56
"name": "test",
57
"t": "c",
58
"unread": 1,
59
"roles": [
60
"owner"
61
]
62
}
63
]
64
},
65
"success": true
66
}
Copied!

Change Log

Version
Description
3.4.0
Added unread property inside rooms object
0.70.0
Added rooms property to response if the user request it and has the view-other-user-channels permission
0.49.0
Updated to support userId or username
0.48.0
Renamed to users.info
0.35.0
Added as user.info
Last modified 6mo ago