Retrieve Profile Details

Get User Profile Detail#

To get the Profile detail of the user, send a request as described below.

await SDK.getUserProfile(`TO_USER_JID`);

Request Param#

StatusDescriptionTypeRequired
TO_USER_JIDJID of the To UserJID Stringtrue

Response Format:#

{
statusCode: 200,
message: "Success",
data: {
email: "", // String - User Email
image: "", // String - User Profile Image
thumbImage: "", // String - User Profile ThumbImage
fromUser: "", // String - From User Jid
nickName: "", // String - User Nickname
mobileNumber: "", // String - User Mobile Number
userStatus: "", // String - Use Profile Status
}
}
note
userprofilelistener also will be triggered with the same response.

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 User's Last Seen Time#

To get the user's last seen, send a request as described below.

await SDK.getLastSeen(`TO_USER_JID`);

Request Param#

StatusDescriptionTypeRequired
TO_USER_JIDJID of the To UserJID Stringtrue

Response Format:#

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

Get Current User Jid#

To get the Jid of the logged in user.

await SDK.getCurrentUserJid();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
userJidJID of the UserJID String

Get User Token#

Generates and retrives new usertoken to access the API.

await SDK.getUserToken(`USERNAME`, `PASSWORD`);

Request Params#

StatusDescriptionTypeRequired
USERNAMEUsernameStringtrue
PASSWORDPasswordStringtrue

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
userTokenUser TokenString