HTTP Method | URL | Requires Auth |
---|---|---|
GET | /api/v1/users.presence | yes |
{% hint style="info" %} If the Presence_broadcast_disabled setting is true, the endpoint returns an empty array. {% endhint %}
Key | Example Value | Description |
---|---|---|
from | 2019-05-22T12:11:45.392Z | The last date when the status was changed. Format: ISO 8601 datetime. Timezone, milliseconds and seconds are optional |
ids | J4sWseCgs8eEnWvhE | The user IDs whose status you want. |
If you don't pass from
parameter, you'll get a list of all users' presence and the result will have a full
field with value true
.
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/users.presence
{
"users":[
{
"_id":"rocket.cat",
"name":"Rocket.Cat",
"username":"rocket.cat",
"status":"online",
"utcOffset":0,
"avatarETag": "5BB9B5ny5DkKdrwkq"
},
{
"_id":"rocketchat.internal.admin.test",
"name":"RocketChat Internal Admin Test",
"username":"rocketchat.internal.admin.test",
"status":"online",
"utcOffset":-2,
"avatarETag": "iEbEm4bTT327NJjXt"
}
],
"full": true,
"success":true
}
If you pass the from
parameter, you'll get only a list of users' presence that has changed after the time of from
parameter. The full
result field will then be false
, indicating it's a partial result.
If the value of from
parameter is older than 10 minutes, the server will reply with a full result set.
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/users.presence?from=2019-05-22T12:11:45.392Z
{
"users":[
{
"_id":"rocket.cat",
"name":"Rocket.Cat",
"username":"rocket.cat",
"status":"online",
"utcOffset":0,
"avatarETag": "5BB9B5ny5DkKdrwkq"
},
{
"_id":"rocketchat.internal.admin.test",
"name":"RocketChat Internal Admin Test",
"username":"rocketchat.internal.admin.test",
"status":"online",
"utcOffset":-2,
"avatarETag": "iEbEm4bTT327NJjXt"
}
],
"full": false,
"success":true
}
Version | Description |
---|---|
1.1.0 | Added |