Profile
Profile related methods are described here.
Register#
To register a new user use the below method. You will get the username and password in the response. By providing that username and password to the connect method you can connect in to the server further.
note
During the initialization, if the isTrialLicenseKey is set to true in the initialization, users will be registered in the trial mode.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
USER_IDENTIFIER | Unique Id to Register the User | String | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| data | Username and Password | Object |
Sample Response:#
Connect with Username#
Make a connection to the server by using the credentials got as a response of the register method. Once the connection is made successfully, it returns a Promise with statusCode of 200, else throws an Error.
This will also emit the connection status. It will be received in connectionListener callback function. If any error occurs while making a connection with the server, You will receive the error in the callback.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
USERNAME | Username | String | true |
PASSWORD | Password | String | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
Login with QR Code#
If Login needs to be done via QR Code scan from Mobile, generate new QR Code with below method.
Once the QR Code scanned successfully, the user will be with XMPP, and username and password will be received in callback response
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
DOM_ELEMENT_ID | Canvas element id in which QR Code has to appended | String | true |
LOGO_ELEMENT_ID | Branding Logo in the QR Code | String | true |
SIGNAL_SERVER_URL | Signal Server URL for Socket Connection | String | true |
Example Request#
Logout#
To disconnect the XMPP connection, use the below method.
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
Get User Profile Detail#
To get the Profile detail of the user, send a request as described below.
Request Param#
| Status | Description | Type | Required |
|---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| data | Profile Details Object | Object |
Check here for response format.
note
userprofilelistener also will be triggered with the same response.
Update User Profile Detail#
To set the Profile detail of the user, send a request as described below.
Once the request is successfully made, a callback userProfileListener will be triggered for the current user and also for the friends (Contacts of the current user) to get the latest profile details.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
NAME | Nickname of the User | String | true |
IMAGE | Profile Image - Upload an image file or image URL | File / String | true |
STATUS | Profile Status | String | true |
MOBILE_NUMBER | Mobile Number | String | true |
EMAIL | Email Address | String | true |
Example Request#
Image as a URL
Image as a FILE
Get User's Last Seen Time#
To get the user's last seen, send a request as described below.
Request Param#
| Status | Description | Type | Required |
|---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| data | Last Seen Details Object | Object |
Check here for response format.
Block User#
Block User method uses to block the User from sending a message to us, it also hides our information from them. Use the below method by passing the JID of the user whom we are blocking.
caution
If Block/unblock feature is unavailable for your plan, then it will throw 403 exception
Request Param#
| Status | Description | Type | Required |
|---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
Unblock User#
To unblock the User use the below method.
caution
If Block/unblock feature is unavailable for your plan, then it will throw 403 exception
Request Param#
| Status | Description | Type | Required |
|---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
Get Users I Blocked#
To get the list of Users whom we blocked, send a request as described below.
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| data | Blocked User List | Array |
Check here for response format.
Get Users Who Blocked Me#
To get the list of Users who blocked Us, send a request as described below.
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| data | Blocked User List | Array |
Check here for response format.
Get Current User Jid#
To get the Jid of the logged in user.
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
| userJid | JID of the User | JID String |
Send Feedback#
To send the feedback about MirrorFly.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
TITLE | Title | String | true |
DESCRIPTION | Description | String | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
Delete My Account#
To delete your MirrorFly account with the feedback.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
REASON | Reason for deleting the account | String | true |
FEEDBACK | Feedback for the improvements in the future | String | false |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
Report User Or Group#
To Report a User or Group by another User.
caution
If Report feature is unavailable for your plan, then it will throw 403 exception
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
TO_USER_JID | JID of User/Group to be reported | JID String | true |
CHAT_TYPE | Chat type either User/Group | String | true |
MESSAGE_DATA_OBJECT | Message data Object that has to reported | Object | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |
Enable/Disable Media Encryption#
To enable/disable the media encryption which was storing in the storage server. By default encryption will be false.
Request Params#
| Status | Description | Type | Required |
|---|---|---|---|
REASON | true - enable the media encryption. false - disable the media encryption | Boolean | true |
Response Params#
| Arguments | Description | Type |
|---|---|---|
| statusCode | Status Code | Number |
| message | Success/Error Message | String |