Get Users Presence

HTTP MethodURLRequires Auth

GET

/api/v1/users.presence

If the Presence_broadcast_disabled setting is true, the endpoint returns an empty array.

Query Parameters

KeyExample ValueDescription

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.

Example Call - Without Parameters

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

Example Response

{
   "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
}

Example Call - With from Parameter

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

Example Response

{
   "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
}

Change Log

VersionDescription

1.1.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.