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 |
#
Request Input for registerMetaDataArguments | Description | Type |
---|---|---|
key | Name of the Key | String |
value | Name of the value | String or Boolean or Number |
#
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:#
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 | Object / 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 IMAGE
#
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 |
#
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 |