Profile
Profile related methods are described here.
#
RegisterTo 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 ParamsStatus | Description | Type | Required |
---|---|---|---|
USER_IDENTIFIER | Unique Id to Register the User. We accept only the AlphaNumeric String | String | true |
FORCE_REGISTER | default value true provide true to force the old session logged out when the registered user has reached the maximum number of multiple-sessions or provide false to allow registration till the maximum no of multiple-sessions reached | Boolean | false |
registerMetaData | registerMetaData is an optional parameter to provide MetaData of user. Maximum size is 3 | Object | false |
#
Request Input for registerMetaDataArguments | Description | Type |
---|---|---|
key | Name of the Key | String |
value | Name of the value | String or Boolean or Number |
caution
If FORCE_REGISTER
is false and if it reached the maximum no of multiple-sessions, then registration will not success and it will throw a 405 exception. Either FORCE_REGISTER
should be true or one of the existing session need to be logged out to continue registration.
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Username, Password, isProfileUpdated, isSandbox, userJid | Object |
#
Sample Response:#
Connect with UsernameMake 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 ParamsStatus | Description | Type | Required |
---|---|---|---|
USERNAME | Username | String | true |
PASSWORD | Password | String | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Sample Response:#
Login with QR CodeIf 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 ParamsStatus | 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#
LogoutTo disconnect the XMPP connection, use the below method.
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Get User Profile DetailTo get the Profile detail of the user, send a request as described below.
#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
#
Response ParamsArguments | 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 DetailTo 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 ParamsStatus | 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 RequestImage as a URL
Image as a FILE
#
Get User's Last Seen TimeTo get the user's last seen, send a request as described below.
#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Last Seen Details Object | Object |
Check here for response format.
#
Block UserBlock 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 ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
#
Unblock UserTo unblock the User use the below method.
caution
If Block/unblock feature is unavailable for your plan, then it will throw 403 exception
#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
#
Get Users I BlockedTo get the list of Users whom we blocked, send a request as described below.
#
Response ParamsArguments | 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 MeTo get the list of Users who blocked Us, send a request as described below.
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Blocked User List | Array |
Check here for response format.
#
Get Current User JidTo get the Jid of the logged in user.
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
userJid | JID of the User | JID String |
#
Get User TokenGenerates and retrives new usertoken to access the API.
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
USERNAME | Username | String | true |
PASSWORD | Password | String | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
userToken | User Token | String |
#
Set User TokenTo set the user token locally.
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
TOKEN | User Token | String | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Send FeedbackTo send the feedback about MirrorFly.
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
TITLE | Title | String | true |
DESCRIPTION | Description | String | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Delete My AccountTo delete your MirrorFly account with the feedback.
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
REASON | Reason for deleting the account | String | true |
FEEDBACK | Feedback for the improvements in the future | String | false |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Report User Or GroupTo Report a User or Group by another User.
caution
If Report feature is unavailable for your plan, then it will throw 403 exception
#
Request ParamsStatus | 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 ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Enable/Disable Media EncryptionTo enable/disable the media encryption which was storing in the storage server. By default encryption will be false.
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
REASON | true - enable the media encryption. false - disable the media encryption | Boolean | true |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |