Update User

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

info

{api-base-url} can be obtained from the MirrorFly console.

HTTP request#

curl --location --request POST "https://{api-base-url}/api/v1/users/{userId}"
--header "accept: */*"
--header "Content-Type: multipart/form-data"
--header "Authorization: AuthToken"
--form "deviceType=":deviceType""
--form "licenseKey=":licenseKey""
--form "userId=":userId""
--form "deviceOsVersion=":deviceOsVersion""
--form "deviceToken=":deviceToken""
--form "voipDeviceToken=":voipDeviceToke""
--form "mode=":mode""
--form "nickname=":nickname""
--form "mobileNumber=":mobileNumber""
--form "email=":email""
--form "profileUrl=":profileUrl""
--form "profileFile=@":profileFile""
--form "metadataKey1=":metadataKey1""
--form "metadataValue1=":metadataValue1""
--form "metadataKey2=":metadataKey2""
--form "metadataValue2=":metadataValue2""
--form "metadataKey3=":metadataKey3""
--form "metadataValue3=":metadataValue3""

Request Params#

ParamDataTypeRequiredDescription
userIdStringYesUserid of the user which you need to update the information. Request path variable
deviceTypeStringYesDevice type where the user is creating. Accepted values (web/ios/android).
licenseKeyStringYesYour license key.
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.
metadataKey1StringNoMetadata key.
metadataValue1StringNoMetadata key1 value.
metadataKey2StringNoMetadata key.
metadataValue2StringNoMetadata key2 value.
metadataKey3StringNoMetadata key.
metadataValue3StringNoMetadata key3 value.

Responses#

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

{
"status": 200,
"data": {
"nickName": "usernickname",
"profileUrl": "",
"profileUrlThumb": "",
"emailId": "sampleuser@gmail.com",
"mobileNumber": "919876543210",
"username": "99xxxxxx11",
"userId": "99xxxxxx11",
"metaData": {
// metadata key/value if any set
}
},
"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"
}