Retrieve Group Details

Get All Groups#

To get the all groups that the user part of, send a request as described below.

await SDK.getGroupsList();

Response Format:#

{
statusCode: 200,
message: "Success",
data: [
{
itemId: "", // String - Item Id - Unique Id for the Group Member
groupId: "", // String - Group Id
groupJid: "", // String - Group Jid
groupName: "", // String - Group Name
groupImage: "", // String - Group Image
thumbImage: "", // String - Group ThumbImage
timestamp: 1681185232000, // Number - Group Created Timestamp -Milliseconds
userType: "", // Number - User Type - "o" - Admin of the Group / "n" - Member of the Group
isAdminBlocked: false // Boolean - If true - Group is blocked by Admin
},
//...
];
}

Get Group Profile Detail#

To get the Profile detail of the group, send a request as described below. Once the request is made successfully, an groupProfileListener callback will be triggered and a group profile response will be received.

await SDK.getGroupProfile(`GROUP_JID`);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGrouop JIDJID Stringtrue

Download Profile Image#

This method is used to get the media file url when we download the profile image.

await SDK.getMediaURL(`fileToken`, `filekey`);

Request Param#

StatusDescriptionTypeRequired
fileTokenFile UrlStringtrue
filekeyFile key is optional param, which we get from the selected Media message BodyStringfalse

Example Requests#

await SDK.getMediaURL("9178680804311682318992048B1cCBm6F6WIVI38s9r1a.jpg", "AllRgIXOXZAHxAzxxggTTQvapoxpzEfx");

Response Format#

{
statusCode: "" // Number - status code,
message: "", // String - Success/Error Message
data: {
blobUrl: "", // String - blobUrl
blob: {
size : "", // Number - size
type : "" // String
}
}
}

Get Group Participants#

To get the all the group members, send a request as described below.

await SDK.getGroupParticipants(`GROUP_JID`);

Response Format:#

data: {
groupJid: "" // String Group Jid
participants: [
{
isAdminBlocked: false // Boolean - Admin Blocked or not
itemId: "", // String - Item Id - Unique Id for the Participant for Group
userId: "", // String - User Id (Without Domain)
userJid: "", // String - User Jid (With Domain)
userType: "", // String - User Type - value "o" - Admin of the Group/ "n" -Member of the Group
userProfile: {
image: "", // String - User Image
nickName: "", // String - User Nick Name
name: "", // String - User Name
email: "", // String - User Email
status: "", // String - User Status
mobileNumber: "", // String - User Mobile Number
thumbImage: "" // String - User ThumbImage
},
timestamp: 1681185232000 // Number TimeStamp - Milliseconds
},
]
};

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDGrouop JIDJID Stringtrue

Get Chat Messages#

To get the chat history of the selected user, send a request to the server as described below.

Response Format:#

{
statusCode: 200,
message: "Success",
userJid: "", // String - Requested User Jid
data: [
{
deleteStatus: "", // Number - Delete Status
favouriteBy: "", // String - Favourited By - User
favouriteStatus: "", // String - Favourite Status
fromUserId: "", // String - From User Id
msgBody: {
media: { // For Media Message Only
caption: "", // String - Media Caption
duration: "", // String - Duration - For Audio/Videos
fileName: "", // String - File Name
file_size: "", // Number - File Size
file_url: "", // String - File Url
is_downloaded: "", // Number - Downloaded Status
is_uploading: "", // Number - Uploading Status
local_path: "", // String - Local Path
thumb_image: "", // Base64 - Thumb Image
}
message: "", // String - Message Body
message_type: "" // String - Message Type
},
fromUserJid: "", // String - From User Jid
msgId: "", // String - Unique Message Id
msgStatus: "", // String - Message Status
createdAt: "", // String - Message Created Time
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
rowId: "", // String - Table Row Id - Used for Fetching Next Paginated Messages
chatType: "", // String - Chat Type - "chat"
},
//...
];
}

Without Pagination

await SDK.getChatMessages(`GROUP_JID`);

With Pagination

await SDK.getChatMessages(`GROUP_JID`, `POSITION`, `LAST_ROW_ID`, `LIMIT`);

Example

await SDK.getChatMessages(
"91XXXXXXXXXX@mix.domain.com",
"down",
"12345",
10,
);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDJID of the To GroupJID Stringtrue
POSITIONPosition for PaginationStringfalse
LAST_ROW_IDLast Row ID of PaginationStringfalse
LIMITPagination LimitNumberfalse

Note: POSITION - Accepts "down"/"up"

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
dataArray of Object datasArray

Get Group Media Messages#

To get the media messages for the particular groupchat. On initial request it fetches three media. Then on the pagination request by passing the last message-id, it fetches 10 next media messages.

Response Format:#

{
statusCode: 200,
message: "Success",
data: [
{
msgId: "", // String - Message Id
message_type: "", // String - Message Type
chatype: "", // String - Chat Type - Values "chat"/"groupchat"
message: "", // String - Message Object
media: {
caption: "", // String - Media Caption
duration: "", // String - Duration - For Audio/Videos
fileName: "", // String - File Name
file_size: "", // Number - File Size
file_url: "", // String - File Url
is_downloaded: "", // Number - Downloaded Status
is_uploading: "", // Number - Uploading Status
local_path: "", // String - Local Path
thumb_image: "", // Base64 - Thumb Image
},
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
},
//...
];
}
caution

If getMediaMessages feature is unavailable for your plan, then it will throw 403 exception

Without Pagination

await SDK.getMediaMessages(`TO_GROUP_JID`);

With Pagination

await SDK.getMediaMessages(`TO_GROUP_JID`, `LAST_MESSAGE_ID`);

Request Params#

StatusDescriptionTypeRequired
TO_GROUP_JIDJID of the GroupJID Stringtrue
LAST_MESSAGE_IDLast Message ID of PaginationStringfalse

Get Group Message Info#

To get the group message info use below method. It retrieves the message info with the number of group members has received and seen the message. Once the request is made successfully, an groupMsgInfoListener callback will be triggered and response will be received;

await SDK.getGroupMsgInfo(`GROUP_JID`, `MESSAGE_ID`);

Request Params#

StatusDescriptionTypeRequired
GROUP_JIDJID of the GroupJID Stringtrue
MESSAGE_IDMessage IDStringtrue

Response Format:#

data: {
groupJid: "", // String - Group Jid (With Domain)
msgId: "", // String - Message Id
participants: [
{
userId: "", // String - User Id
msgStatus: "", // String - Message Status - 0 Not Delivered, 1- Delivered, 2 - Seen
deliveredTime: "", // String - Message Delivered Time "0000-00-00 00:00:00"
seenTime: "", // String - Message Seen Time "0000-00-00 00:00:00"
},
//...
]
}