Update User

To update the user information based on the user id you can use the below API.

HTTP request#

curl --location --request POST 'https://{your-domain-name}/api/v1/users/{userId}' \
--header 'accept: */*' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: :AuthToken' \
--form 'deviceType=":deviceType"' \
--form 'licenseKey=":licenseKey"' \
--form 'userIdentifier=":userIdentifier"' \
--form 'deviceOsVersion=":deviceOsVersion"' \
--form 'deviceToken=":deviceToken"' \
--form 'voipDeviceToken=":voipDeviceToke"' \
--form 'mode=":mode"' \
--form 'nickname=":nickName"' \
--form 'mobileNumber=":mobileNumber"' \
--form 'email=":emailId"' \
--form 'profileUrl=":profileUrl"' \
--form 'profileFile=@":profileFile"

Request Params#

ParamDataTypeRequiredDescription
userIdStringYesUserid of the user which you need to retrieve the information. Request path variable
deviceTypeStringYesDevice type where the user is creating. Accepted values (web/ios/android).
licenseKeyStringYesYour license key.
userIdentifierStringYesUnique user identifier. Max of 191 chars allowed.
deviceOsVersionStringNoDevice os version.
deviceTokenStringNoDevice token to receive the push notification for android/ios devices.
voipDeviceTokenStringNoVoip device token to receive the call related push notification for the ios devices.
modeIntNoMode to denote the ios sandbox/production mode to receive the push notifications. 0 - production, 1 - sandbox/debug
nicknameStringNoNickname of the user. Max of 30 chars allowed.
mobileNumberStringNoMobile number of the user. Max of 15 chars allowed.
emailStringNoEmail Id of the user.
profileUrlStringNoIf you already having the profile image url, then you can use this param to store the data. Max of 2048 chars allowed.
profileFileFileNoIf you need to upload the image, then you can use this param to upload the image and retrieve the profile url which will be access via the Mirrorfly SDK’s and API’s only. Accepted files are png, jpeg and jpg.

Responses#

If successful, this action returns a user resource in the response body.

{
"status": 200,
"data": {
"nickName": "Sample user",
"profileUrl": "",
"emailId": "sampleuser@gmail.com",
"mobileNumber": "919876543210"
},
"message": "Data retrieved successfully"
}

Error#

In the case of an error, an error object like below is returned.

When the token passed in Headers is not given or expired

{
"status": 401,
"message": "Token Expired"
}

In the case of a Bad Request, an error message is returned

{
"status": 400,
"message": "Error Message"
}