Get
/api/v1/dm.counters
Gets counters and information of direct messages. Permission required: view-room-administration
.
Changelog
Version | Description |
---|---|
0.65.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Query parameters
roomId
stringRequired
The DM room ID
userId
string
The user ID to provide counters for.
Responses
200
OK
Note
joined
: Boolean flag that shows that user has joined the room or not.members
: Count of current room members.unreads
: Count of unread messages for specified user (calling user or provided user ID).unreadsFrom
: Start date-time of unread interval for specified user.msgs
: Count of messages in the room.latest
: End date-time of unread interval for specified user (or date-time of last posted message).userMentions
- Count of user mentions in messages.
Example 1
{
"joined": true,
"members": 2,
"unreads": 4,
"unreadsFrom": "2023-10-30T20:30:47.975Z",
"msgs": 10,
"latest": "2023-10-30T20:37:17.160Z",
"userMentions": 0,
"success": true
}
object
joined
boolean
members
integer
unreads
integer
unreadsFrom
string
msgs
integer
latest
string
userMentions
integer
success
boolean
400
Bad Request
Example 1
{
"success": false,
"error": "Query param \"roomId\" is required [error-room-param-not-provided]",
"errorType": "error-room-param-not-provided"
}
object
success
boolean
error
string
errorType
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string