Create a direct message session with another user or more than one user.
Change Log
| Version | Description |
|---|---|
| 0.59.0 | Added |
| 3.1.0 | Added usernames fields |
| 3.18.0 | Added excludeSelf option |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"username": "kim.dok",
"excludeSelf": true
}The username of the user to open a direct message session.
Creates the direct message session excluding the current authenticated user. The session will only be opened if the current user has the view-room-administration permission
Comma-seperated list of usernames to open a multiple direct message session.
Creates the direct message session excluding the current authenticated user. The session will only be opened if the current user has the view-room-administration permission
OK
{
"room": {
"t": "d",
"rid": "PMrDaS4axRqkjY7errocket.cat",
"usernames": [
"g1",
"rocket.cat"
]
},
"success": true
}Bad Request
{
"success": false,
"error": "must have required property 'usernames'\n must have required property 'username'\n must match exactly one schema in oneOf [invalid-params]",
"errorType": "invalid-params"
}{
"success": false,
"error": "Invalid user [error-invalid-user]",
"errorType": "error-invalid-user",
"details": {
"method": "createDirectMessage"
}
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}