Invite Users to Group
- Print
- DarkLight
- PDF
Invite Users to Group
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Post
/api/v1/groups.invite
Invite one user or bulk users to the group/channel.
Changelog
Version | Description |
---|---|
0.48.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
Body parameters
Example
{
"roomId": "ByehQjC44FwMeiLbX",
"userId": "nSYqWzZ4GsKTX4dyK"
}
object
roomId
string Required
The group ID
userId
string Required
The ID of the user to be invited. You can also use the parameter userIds
as an array to invite more than one user. For example, ["nSYqWzZ4GsKTX4dyK", "SYqWzZ4Gsasdfgh"]
Responses
200
OK
Success
{
"group": {
"_id": "ByehQjC44FwMeiLbX",
"ts": "2016-11-30T21:23:04.737Z",
"t": "p",
"name": "testing",
"usernames": [
"testing",
"testing1"
],
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "testing1"
},
"msgs": 1,
"_updatedAt": "2016-12-09T12:50:51.575Z",
"lm": "2016-12-09T12:50:51.555Z"
},
"success": true
}
object
group
object
_id
string
ts
string
t
string
name
string
usernames
Array of string
string
u
object
_id
string
username
string
msgs
integer
_updatedAt
string
lm
string
success
boolean
400
Bad Request
Permission required
{
"success": false,
"error": "Not allowed [error-not-allowed]",
"errorType": "error-not-allowed",
"details": {
"method": "addUsersToRoom"
}
}
object
success
boolean
error
string
errorType
string
details
object
method
string
Was this article helpful?