Other chat features

Get Jid based on Username/Userid#

Use the below method to generate your own or others JID using the unique username got in registration response.

SDK.getJid(`USER_ID`);

Example Request#

SDK.getJid(`123456789`);

Example Response#

{
statusCode: 200,
message: "Success",
userJid: "123456789@xmppdomain"
}

Get GroupJid based on Groupid#

Use the below method to generate your own or others GroupJID using the GroupId.

SDK.getGroupJid(`GROUP_ID`);

Example Request#

SDK.getGroupJid(`0f617991-08d0-4474-ae6c-f070dc63bb1a`);

Example Response#

{
statusCode: 200,
message: "Success",
userJid: "0f617991-08d0-4474-ae6c-f070dc63bb1a@mix.xmppdomain"
}

Get Message based on MsgId#

Use the below method to get the message using the messageId which you got.

SDK.getMessageById(`MSG_ID`);

Example Request#

SDK.getMessageById(`815f37b5-1f8f-4a39-8237-247c44b1b521`);

Example Response#

{
statusCode: 200,
message: "Success",
data:{
chatType: "", // String - Chat Type - "chat" - Single - "groupchat" - Group
createdAt: "", // String - CreatedAt - "2023-04-11 09:23:52"
deleteStatus: 0, // Number - Delete Status
deletedBy: "0", // String - Deleted By
fromUserId: "", // String - From User Id
fromUserJid: "", // String - From User Jid -
// Will Be Same as PublisherJid in Case of Single Chat
// GroupJid in Case of Group Chat
msgBody: {
message: '', // String - Message Body
message_type: '', // String - Message Type text, image, video, audio & file
mentionedUsersIds: [], // Array - Mentioned Ids In case of Group
nickName: '', // String - User Nickname
}
msgId: "", // String - Message Id
msgStatus: 2, // Number - Message Status
msgType: "", // String - value ""
profileUpdatedStatus: "" // String
publisherJid: "", // String - Jid - PublisherJid
publisherId: "", // String - Id - Publisher Id
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
userId: "", // String - UserId
userJid: "", // String - UserJid
},
}

Emojis#

Our service allows you to send emojis of any kind, without any encryption.

Translate Message#

Get All Available Translate Languages#

Retrives all Available languages for the Translate from the Google API.

caution

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

SDK.getTranslateLanguages(`API_KEY`, `TARGET_LANGUAGE`);

Example Request#

Retrives the Translated Text for the provided Text with Target Language.

SDK.getTranslateLanguages(`AIza******************`, `en`);

Response:

{
statusCode: 200,
message: "Success",
data: {
languages: [
{
language: "af" name: "Afrikaans"
},
{
language: "sq", name: "Albanian"
},
//...
]
}
}

Translate the Message#

caution

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

SDK.translateText(`API_KEY`, `MESSAGE_TO_TRANSLATE`, `TARGET_LANGUAGE`);

Example Request#

SDK.translateText(`AIza******************`, `Hello, This is Sample Text`, `ta`);

Response:

{
statusCode: 200,
message: "Success",
data: {
translations: [
{
detectedSourceLanguage: "ta",
translatedText: "வணக்கம்"
}
]
}
}

User Settings#

Handles User Settings for Archived Chats.

Get User Settings#

await SDK.getUserSettings();

Response Format:#

data: {
archive: 1 // Number 1 - Permanent / - 0 - Temporary
}

Update User Settings#

await SDK.updateUserSettings(`IS_PERMANENT_ACHIVE_ENABLED`);

Request Params#

StatusDescriptionTypeRequired
IS_PERMANENT_ACHIVE_ENABLEDtrue - Permanent, false - TemporaryBooleantrue

User Profile Details#

Handles User Profile Response, when Get User Profile method called. Receives object values.

Response Format:#

data: {
email: "", // String - User Email
fromUser: "", // String - From User Jid
image: "", // String - User Profile Image
isAdminBlocked: false // Boolean - If true - Group is blocked by Admin
mobileNumber: "", // String - User Mobile Number
nickName: "", // String - User Nickname
status: "", // String - Use Profile Status
thumbImage: "", // String - User Profile ThumbImage
userId: "", // String - User Id (Without Domain)
}

Last Seen Time#

Handles Last Seen Time Respone, when Get Last Seen method called. Receives object values.

Response Format:#

data: {
fromUserJid: "", // String - From User Jid
seconds: 0, // Number - In Seconds
}

Note: If the seconds is 0, then the requested user is Online

Recent Chat Messages#

Handles Recent Chat Respones, when Get Recent Chats method called. Receives an array of object values.

Response Format:#

data: [
{
archiveStatus: 0, // Number - Archive Status
chatType: "", // String - Chat Type "chat"/"groupchat"
createdAt: "", // String - Created Time
deleteStatus: 0, // Number - Delete Status (Recall)
fromUserId: "", // String - From User Id
msgBody: {
media: { // For Media Message Only
androidHeight: 188, // Number - Android Height -Only For Image/Video
androidWidth: 250, // Number - Android Width -Only For Image/Video
caption: "", // String - Media Caption
duration: 29070, // Number - Duration - For Audio/Videos, Otherwise 0
file: { // Object - File
caption: "", // String - Caption - Only for Image/Video
fileDetails: {
androidHeight: 188, // Number - Android Height - For Video
androidWidth: 250, // Number - Android Width - For Video
audioType: "", // String - AudioType - Only for Audio
duration: 30800, // Number - Duration -Only for Audio/Video
fileId: "", // String - File Id
imageUrl: "", // String - Image Url - For Image/Video/Audio
msgType: "", // String - MessageType - Image/Video/Audio/File
replyTo: "", // String - MessageId - For reply message
originalHeight: 240, // Number - Original Height - For Video
originalWidth: 320, // Number - Original Width - For Video
webHeight: 248, // Number - Web Height - For Video
webWidth: 330 // Number - Web Width - For Video
}
mentionedUsersIds: [] // Array - In case of GroupChat - for Image/Video
}
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height -Only For Image/Video
originalWidth: 320, // Number - Original Width -Only For Image/Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height -Only For Image/Video
webWidth: 330 // Number - Web Width -Only For Image/Video
}
mentionedUsersIds: [], // Array - Mentioned Ids For groupChat
message: "", // String - Message Body
message_type: "", // String - Message Type
nickName: "", // String - User Name
replyTo: "", // String - MsgId - In case of reply message
},
msgId: "", // String - Unique Message Id
msgStatus: 0, // Number - Message Status
msgType: "", // String - Message Type
muteStatus: 0, // Number - Mute Status
publisherId: "", // String - Publisher Id
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
toUserId: "", // String - To User Id
unreadCount: 0, // Number - Unread Message Count
updatedAt: "", // String - Updated Time
userId: "" // String - Notification To
},
//...
];

Single Chat Conversation History Messages#

Handles Single Chat Respones, when Get Chat Messages method called. Receives an array of object values.

Response Format:#

userJid: "", // String - Requested User Jid For SingleChat
data: [
{
chatType: "", // String - Chat Type - "chat"
createdAt: "", // String - Message Created Time
deleteStatus: "", // Number - Delete Status
favouriteBy: "", // String - Favourited By - User
favouriteStatus: 0, // Number - Favourite Status
fromUserId: "", // String - From User Id
fromUserJid: "", // String - From User Jid
msgBody: {
media: { // For Media Message Only
androidHeight: 188, // Number - Android Height -Only For Image/Video
androidWidth: 250, // Number - Android Width -Only For Image/Video
caption: "", // String - Media Caption
duration: 29070, // Number - Duration - For Audio/Videos, Otherwise 0
file: { // Object - File
caption: "", // String - Caption - Only for Image/Video
fileDetails: {
androidHeight: 188, // Number - Android Height - For Video
androidWidth: 250, // Number - Android Width - For Video
audioType: "", // String - AudioType - Only for Audio
duration: 30800, // Number - Duration -Only for Audio/Video
fileId: "", // String - File Id
imageUrl: "", // String - Image Url - For Image/Video/Audio
msgType: "", // String - MessageType - Image/Video/Audio/File
replyTo: "", // String - MessageId - For reply message
originalHeight: 240, // Number - Original Height - For Video
originalWidth: 320, // Number - Original Width - For Video
webHeight: 248, // Number - Web Height - For Video
webWidth: 330 // Number - Web Width - For Video
}
mentionedUsersIds: [] // Array - In case of GroupChat - for Image/Video
}
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height -Only For Image/Video
originalWidth: 320, // Number - Original Width -Only For Image/Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height -Only For Image/Video
webWidth: 330 // Number - Web Width -Only For Image/Video
}
mentionedUsersIds: [], // In case of groupChat - MentionedUsersIds,Otherwise empty
message: "", // String - Message Body
message_type: "", // String - Message Type
nickName: "", // String - Nickname
replyTo: "", // String - MsgId - In case of reply message
},
msgId: "", // String - Unique Message Id
msgStatus: 2, // Number - Message Status
rowId: "", // String - Table Row Id - Used for Fetching Next Paginated Messages
timestamp: 1681185232000 // Number - TimeStamp - Milliseconds
},
//...
];

Media Messages#

Handles Single/Group Chat Media Response, when Get Media Messages method called. Receives an array of object values.

Single Chat Response Format:#

Sample Response:

data: [
{
chatype: "", // String - Chat Type - Values "chat"
media: {
androidHeight: 188, // Number - Android Height -Only For Image/Video
androidWidth: 250, // Number - Android Width -Only For Image/Video
caption: "", // String - Media Caption
duration: 29070, // Number - Duration - For Audio/Videos, Otherwise 0
file: { // Object - File
caption: "", // String - Caption - Only for Image/Video
fileDetails: {
androidHeight: 188, // Number - Android Height - For Video
androidWidth: 250, // Number - Android Width - For Video
audioType: "", // String - AudioType - Only for Audio
duration: 30800, // Number - Duration -Only for Audio/Video
fileId: "", // String - File Id
imageUrl: "", // String - Image Url - For Image/Video/Audio
msgType: "", // String - MessageType - Image/Video/Audio/File
replyTo: "", // String - MessageId - For reply message
originalHeight: 240, // Number - Original Height - For Video
originalWidth: 320, // Number - Original Width - For Video
webHeight: 248, // Number - Web Height - For Video
webWidth: 330 // Number - Web Width - For Video
}
mentionedUsersIds: [] // Array - In case of GroupChat - for Image/Video
}
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height -Only For Image/Video
originalWidth: 320, // Number - Original Width -Only For Image/Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height -Only For Image/Video
webWidth: 330 // Number - Web Width -Only For Image/Video
},
mentionedUsersIds: [], // Array - MentionedUsersIds, Incase of GroupChat
message: "", // String - Message Object
message_type: "", // String - Message Type
msgId: "", // String - Message Id
nickName: "", // String - Nickname
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
},
//...
];

Group Chat Response Format:#

Sample Response:

data: [
{
chatype: "", // String - Chat Type - Values "groupchat"
media: {
androidHeight: 188, // Number - Android Height - For Image/Video, otherwise 0
androidWidth: 250, // Number - Android Width - For Image/Video, otherwise 0
audioType: "", // String - AudioType value "file" - Only for Audio
caption: "", // String - Caption - For Image/Video, Otherwise ""
duration: 30800, // Number - Duration - For Audio/Videos, Otherwise 0
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height - For Image/Video, otherwise 0
originalWidth: 320, // Number - Original Width - For Image/Video, otherwise 0
thumbImage: "", // String - ThumbImage - Only for Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height - For Image/Video, otherwise 0
webWidth: 330 // Number - Web Width - For Image/Video, otherwise 0
},
mentionedUsersIds: [], // Array - MentionedUsersIds
message: "", // String - Message Object
message_type: "", // String - Message Type
msgId: "", // String - Message Id
nickName: "", // String - Nickname
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
},
//...
];

Reply Message#

Handles Reply Message Response, when Get Reply Messages method called. Receives object values.

Response Format:#

data: {
chatType: "", // String - Chat Type
deletedStatus: 0, // Number - Delete Status
deletedBy: "", // String - Deleted By
fromUserId: "", // String - Reply From User Id
groupId: undefined
oldMsgId: "", // String - Old Message Id
replyMsgContent: { // Object - Reply Message Content
media: { // For Media Message only
androidHeight: 188, // Number - Android Height -Only For Image/Video
androidWidth: 250, // Number - Android Width -Only For Image/Video
caption: "", // String - Media Caption
duration: 29070, // Number - Duration - For Audio/Videos, Otherwise 0
file: { // Object - File
caption: "", // String - Caption - Only for Image/Video
fileDetails: {
androidHeight: 188, // Number - Android Height - For Video
androidWidth: 250, // Number - Android Width - For Video
audioType: "", // String - AudioType - Only for Audio
duration: 30800, // Number - Duration -Only for Audio/Video
fileId: "", // String - File Id
imageUrl: "", // String - Image Url - For Image/Video/Audio
msgType: "", // String - MessageType - Image/Video/Audio/File
replyTo: "", // String - MessageId - For reply message
originalHeight: 240, // Number - Original Height - For Video
originalWidth: 320, // Number - Original Width - For Video
webHeight: 248, // Number - Web Height - For Video
webWidth: 330 // Number - Web Width - For Video
}
mentionedUsersIds: [] // Array - In case of GroupChat - for Image/Video
}
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height -Only For Image/Video
originalWidth: 320, // Number - Original Width -Only For Image/Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height -Only For Image/Video
webWidth: 330 // Number - Web Width -Only For Image/Video
},
mentionedUsersIds: [], // Array - MentionedUsersIds
message: "", // String - Message Object
message_type: "", // String - Message Type
nickName: "", // String - Nickname
}
replyMsgId: "", // String - Reply Message Id
}

Groups List#

Handles Groups lists Respones, when Get All Groups method called. Receives an array of object values.

Response Format:#

data: [
{
groupId: "", // String - Group Id
groupImage: "", // String - Group Image
groupJid: "", // String - Group Jid
groupName: "", // String - Group Name
isAdminBlocked: false // Boolean - If true - Group is blocked by Admin
itemId: "", // String - Item Id - Unique Id for the Group Member
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
},
//...
];

Group Participants List#

Handles Groups Participants list Response, when Get Group Participant method called. Receives an array of object values.

Response Format:#

data: {
statusCode: 200, // Number - status code
message: "", // String - Success/Error Message
groupJid: "" // String Group Jid
participants: [ // Array - list of Participants
{
isAdminBlocked: false // Boolean - Admin Blocked or not
itemId: "", // String - Item Id - Unique Id for the Participant for Group
timestamp: 1681185232000 // Number TimeStamp - Milliseconds
userId: "", // String - User Id (Without Domain)
userJid: "", // String - User Jid (With Domain)
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
},
userType: "" // String - User Type - value "o" - Admin of the Group/ "n" -Member of the Group
},
]
//...
};

Group Chat Conversation History Messages#

Handles Group Chat Messages Respones, when Get Chat Messages method called. Receives an array of object values.

Response Format:#

groupJid: "", // String - Requested Group Jid
data: [
{
chatType: "", // String - Chat Type - "groupchat"
createdAt: "", // String - Message Created Time
deleteStatus: "", // Number - Delete Status
favouriteBy: "", // String - Favourited By - User
favouriteStatus: 0, // Number - Favourite Status
fromUserId: "", // String - From User Id
msgBody: {
media: { // For Media Message Only
androidHeight: 188, // Number - Android Height -Only For Image/Video
androidWidth: 250, // Number - Android Width -Only For Image/Video
caption: "", // String - Media Caption
duration: 29070, // Number - Duration - For Audio/Videos, Otherwise 0
file: { // Object - File
caption: "", // String - Caption - Only for Image/Video
fileDetails: {
androidHeight: 188, // Number - Android Height - For Video
androidWidth: 250, // Number - Android Width - For Video
audioType: "", // String - AudioType - Only for Audio
duration: 30800, // Number - Duration -Only for Audio/Video
fileId: "", // String - File Id
imageUrl: "", // String - Image Url - For Image/Video/Audio
msgType: "", // String - MessageType - Image/Video/Audio/File
replyTo: "", // String - MessageId - For reply message
originalHeight: 240, // Number - Original Height - For Video
originalWidth: 320, // Number - Original Width - For Video
webHeight: 248, // Number - Web Height - For Video
webWidth: 330 // Number - Web Width - For Video
}
mentionedUsersIds: [] // Array - In case of GroupChat - for Image/Video
}
fileName: "", // String - File Name
file_key: "", // String - File Key
file_size: 543879, // Number - File Size
file_url: "", // String - File Url
is_downloaded: 0, // Number - Downloaded Status
is_uploading: 2, // Number - Uploading Status
local_path: "", // String - Local Path
msgId: "", // String - MessageId
originalHeight: 240, // Number - Original Height -Only For Image/Video
originalWidth: 320, // Number - Original Width -Only For Image/Video
thumb_image: "", // Base64 - Thumb Image
webHeight: 248, // Number - Web Height -Only For Image/Video
webWidth: 330 // Number - Web Width -Only For Image/Video
}
mentionedUsersIds: [], // Array - MentionedUsersIds
message: "", // String - Message Body
message_type: "", // String - Message Type
nickName: "", // String - Nickname
replyTo: "", // String - MsgId - In case of reply message
},
msgId: "", // String - Unique Message Id
msgStatus: 0, // Number - Message Status
msgType: "", // String - Group Message Type
publisherId: "", // String - Publisher Id
rowId: "", // String - Table Row Id - Used for Fetching Next Paginated Messages
status: 0, // Number - Group Message Status
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
userId: "", // String - User Id
},
//...
];

Set Group Profile#

Handles the set group Profile response, when Set Group profile method called. Receives Object values.

Response Format:#

{
statusCode: 200, // Number - status code
message: "", // String - Success/Error Message
fileToken: "", // String - File Token
fileTokenThumb: "" // String - File Token Thumb
}

Get Group Profile#

Handles the Get group Profile response, when Get Group profile method called. Receives Object values.

Response Format:#

statusCode: 200, // Number - status code
message: "", // String - Success/Error Message
data: {
groupId: "", // String - Group Id
groupImage: "", // String - Group Image
groupJid: "", // String - Group Jid
groupName: "", // String - Group Name
isAdminBlocked: false // Boolean - If true - Group is blocked by Admin
itemId: "", // String - Item Id - Unique Id for the Group Member
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
}

Group Message Info#

Handles Group Message Info Respones, when Get Group Message Info method called. Receives an array of object values.

Response Format:#

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

Users I Blocked#

Handles Blocked List IQs (Users who are all blocked by the current user), triggered when Get Users I Blocked method called. Receives an array of object values.

Response Format:#

data: [
{
jid: "", // String - Jid of the User
},
//...
];

Users Who Blocked Me#

Handles Blocked Users List IQs (Users who have blocked the current user), triggered when Get Users Who Blocked Me method called. Receives an array of object values.

Response Format:#

data: [
{
jid: "", // String - Jid of the User
},
//...
];

User/Group Blocked/Unblocked By Admin#

Handles Blocked/Unblocked response from Admin Console for the user/group. This response is triggered when the console admin particularly blocks/unblocks an user/group in Callback adminBlockListener. Receives Blocked User/groups 's UserId and Jid with blocked status.

Response Format:#

{
chatType: "", // String - either Group or Single Chat
toUserJid: "", // String - Blocked User/Group's Jid
blockStatus: "", // string - User/Group's Blocked Status (either 1(true) or 0(false))
toUserId: "", // String - Blocked User/Group's User-ID
type: "" // String
}

Get MetaData For User#

Use the below method to get your own metaData.

await SDK.getMetaData();

Example Response#

{
statusCode: 200,
message: "Data Retrieved Successfully",
metaData:
{
type:"test",
phone:"1234567890"
}
}

Update MetaData For User#

Use the below method to update your own metaData.

await SDK.updateMetaData(`Update_MetaData`);

Request Param#

StatusDescriptionTypeRequired
Update_MetaDataUpdate_MetaData is an optional parameter to update MetaData of user. Maximum size is 3Objectfalse

Request Input for Update_MetaData#

ArgumentsDescriptionType
keyName of the KeyString
valueName of the valueString or Boolean or Number

Example Response#

{
statusCode: 200,
message: "User Successfully Updated",
metaData:
{
method:"update"
}
}
note

You didn't pass param (Update_MetaData) to updateMetaData SDK method, it should be considered as a null and updated user MetaData as a null.