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:#

{
"message": "",// String - Success/Error Message
"statusCode": "" // Number - status code
"data": {
"email": "",// String - User Email
"fromUser": "",//String - from User Mobile Number
"image": "",// String - User Profile Image
"isAdminBlocked": 0,
"mobileNumber": "",// String - User Mobile Number
"nickName": "",//String - User Nickname
"status": "", // String - Use Profile Status
"thumbImage": "",
"userId": "",// String - UserId
"userJid": ""// String - UserJid
},
}
note
userprofilelistener also will be triggered with the same response.

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
}
}

User List#

To retrieve all registered users on MirrorFly SDK use below method. User list can also be retrieved based on search key word, also this method supports pagination. This function will return the total number of pages.

warning

User presence and Profile instant update will not happen until a message is sent to that particular user.

await SDK.getUsersList(`NAME`, `PAGE`, `LIMIT`);

Request Params#

ArgumentsDescriptionTypeRequired
NAMEName to search against the name default value is emptyStringfalse
PAGEPage to get the particular pages default value is 1Numberfalse
LIMITLimit to set the number of users per page default value is 20Numberfalse

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
usersArray of Users ObjectArray

Response Format:#

data: [
{
name: "", // String - Name of the User
image: "", // String - Profile Image of the User
thumbImage: "", // String - Profile ThumbImage of the User
email: "", // String - User Email
status: "", // String - User Status
userJid: "", // String - Jid of the User
userId: "", // String - User Id
nickName: "", // String - Nick Name of the User
mobileNumber: "", // String - User Mobile Number
},
//...
];

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