Profile module
Profile related methods are described here.
#
RegisterTo register a new user use the below method.
If autoLogin is true, after successful registration, the user will be logged in with XMPP.
Note: If the sandbox mode is set to
true
in the initialization, users will be registered in the sandbox mode
#
Request ParamsStatus | Description | Type | Required |
---|---|---|---|
USER_IDENTIFIER | Unique Id to Register the User | String | true |
AUTO_LOGIN | Auto Login after Registration | Boolean | false |
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Username and Password | Object |
#
Sample Response:If autoLogin
is true
If autoLogin
is false
#
Login with UsernameMake a connection by login into the XMPP server using the credentials. 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 |
#
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 Friends ListTo get the friends list, send a request as described below.
#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Array of Users Object | Array |
Check here for response format
Note: friendsListListener also will be triggered with the same response.
#
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.
#
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.
#
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 |