Update Device Token

To update the user's device information by username, you can use the below API.

info

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

HTTP request#

curl -X PUT "https://{api-base-url}/api/v1/users/updatedevicetoken"
--header "accept: */*"
--header "Authorization: AuthToken"
--header "Content-Type: application/json"
--form "username=":username""
--form "deviceType=":deviceType""
--form "deviceId=":deviceId""
--form "deviceOsVersion=":deviceOsVersion""
--form "deviceToken=":deviceToken""
--form "voipDeviceToken=":voipDeviceToken""

Request Params#

ParamDataTypeRequiredDescription
usernameStringYesThe user's username whose device information has to be updated.
deviceTypeStringYesDevice type to updated.
deviceIdStringNoDevice Id to be updated.
deviceOsVersionStringNoDevice os version to be updated.
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.

Responses#

If successful, this action returns below response.

{
"status": 200,
"message": "Data updated 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"
}