Chat Platform API v3
Chat Platform API
Chat
Platform API
Invites one or more users as members to a group channel. See this page to learn more about channel types.
Note: Users can join a group channel right after receiving an invitation, without having to accept it. To give users an option to accept or decline an invitation, see update default channel invitation preference or update channel invitation preference.
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|
channel_url | string | Specifies the URL of the channel. |
The following table lists the properties of an HTTP request that this action supports.
Properties
Required | Type | Description |
---|
user_ids[] | array of strings | Specifies an array of one or more user IDs to invite to the channel. Up to 100 users can be invited at a time. The users property can be used instead of this property. |
users[] | array of objects | Specifies a list of one or more JSON objects containing the user_id property to invite to the channel. Up to 100 users can be invited at a time. The user_ids property can be used instead of this property. |
Optional | Type | Description |
---|
invitation_status | object | Specifies one or more key-value pair items which set the invitation status of each user invited to the channel. Each key-value pair should be specified with the invited user's ID, a colon (:), and the user’s invitation status (for example, user_id_1: invitation status ). Acceptable values are joined, invited_by_friend, and invited_ by_non_friend. (Default: joined) |
hidden_status | object | Specifies one or more key-value pair items which set the channel's hidden status for each user. The value in hidden_status determines whether to hide the channel from the user's channel list. Each key-value pair should be specified with the invited user's ID, a colon (:), and the channel's hidden status (for example, user_id_1: channel hidden status ). Acceptable values are the following: - unhidden (default): the channel is shown when a user's channel list is retrieved. - hidden_allow_auto_unhide: if a new message is sent to a hidden channel, the channel automatically reappears on a user's channel list. - hidden_prevent_auto_unhide: the channel doesn't reappear on a user's channel list even when a new message is sent to that channel. |
If successful, this action returns a group channel resource in the response body.
In the case of an error, an error object is returned. A detailed list of error codes is available here.