Mentioning a User
To mention the user(participant) along with a message in a group, Use this below methods to pass mentionedUsersIds param provided to all kind of messages such as Text, Image, video, Audio, Document.
Text Message#
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| messageText | Text Message Body | String | true |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Response Format:#
Image Message#
caution
If Image attachment feature is unavailable for your plan, then it will throw 403 exception
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| fileMessageParams | File Message Params | Object | true |
| fileMessageParams.file | Image File - Should be of type png, jpg, jpeg, svg & gif | File | true |
| fileMessageParams.thumbImage | Image File Thumb Image. When the value not given, SDK will generate thumb image for the given FILE. When using the fileUrl SDK won't generate the thumb image. | String | false |
| fileMessageParams.fileSize | Image File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
| fileMessageParams.fileName | Image File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
| fileMessageParams.caption | Image Caption | String | false |
| replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Response Format:#
Audio Message#
caution
If Audio attachment feature is unavailable for your plan, then it will throw 403 exception
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| fileMessageParams | File Message Params | Object | true |
| fileMessageParams.file | Audio File - Should be of type mp3, mpeg & wav | File | true |
| fileMessageParams.fileSize | Audio File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
| fileMessageParams.fileName | Audio File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
| fileMessageParams.duration | Audio File Duration. When the value not given, SDK will detect the duration of the given FILE. When using the fileUrl SDK won't detect the duration. | String | false |
| fileMessageParams.caption | Audio Caption | String | false |
| replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Response Format:#
Video Message#
caution
If Video attachment feature is unavailable for your plan, then it will throw 403 exception
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| fileMessageParams | File Message Params | Object | true |
| fileMessageParams.file | Video File - Should be of type mp4 | File | true |
| fileMessageParams.fileSize | Video File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
| fileMessageParams.fileName | Video File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
| fileMessageParams.duration | Video File Duration. When the value not given, SDK will detect the duration of the given FILE. When using the fileUrl SDK won't detect the duration. | String | false |
| fileMessageParams.thumbImage | Video File Thumb Image. When the value not given, SDK will generate thumb image for the given FILE. When using the fileUrl SDK won't generate the thumb image. | String | false |
| fileMessageParams.caption | Video Caption | String | false |
| replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Response Format:#
Document Message#
caution
If Document attachment feature is unavailable for your plan, then it will throw 403 exception
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| fileMessageParams | File Message Params | Object | true |
| fileMessageParams.file | Document File - Accepted files are pdf, doc, xls, csv, ppt & txt | File | true |
| fileMessageParams.fileSize | Document File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
| fileMessageParams.fileName | Document File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
| fileMessageParams.caption | Document Caption | String | false |
| replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Response Format:#
Send Reply Message#
To send a reply to the original message, we are using sendTextMessage by passing in the additional parameter original message-id.
Request Param#
| Param | Description | Type | Required |
|---|---|---|---|
| toJid | JID of the Group | JID String | true |
| messageText | Text Message Body | String | true |
| replyMessageId | Message ID of Original Message | String | true |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array | false |
| topicId | Topic Id for the Message | String | false |
| metaData | MetaData for the Message | Object | false |
Receive Message#
To receive the incoming message from other users, you need to implement the event messageListener , which will be triggered whenever a new message is received. Once the message is received it automatically send the delivery status to the user if the logged-in user is online.
When Receives message with mentioned users in group, the mentionedUserIds are received in messageListener callback response body. Click here to check the received response format for groupchat.