Contact Sync

To upload the all phone book contacts to the server to get the live contacts.

info

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

HTTP request#

curl -X POST "https://{api-base-url}/api/v1/contacts/syncContactsNew"
-H "accept: */*"
-H "Authorization: :AuthToken"
-H "Content-Type: application/json"
-d "{ \"addContacts\": [ { \"mobileNumber\": \"99xxxxxx11\", \"name\": \"samplename\" } ], \"contactPermission\": true, \"deleteContacts\": [ { \"mobileNumber\": \"99xxxxxx11\", \"name\": \"samplename\" } ], \"forceDelete\": true}"

Request Params#

ParamDataTypeRequiredDescription
mobileNumberStringNoMobile number in user Phone book
nameStringNoContact name in user Phone book
contactPermissionBooleanYesDevice contacts access permission default value is true
forceDeleteBooleanYesForce delete means, its defines to delete previous contacts for the users. While the User Login contact sync, value should be true after login contacts sync should be false
addContactsArray ListYesShould be added the phone book contacts in user login time and if any newly added contacts are available will be added after login and contact sync
deleteContactsArray ListYesDeleted contacts will be added after the contacts sync

Responses#

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

{
"status": 200,
"data": {
"liveContacts": [
{
"name": "samplename",
"mobileNumber": "99xxxxxx11"
}
]
},
"message": "Contact Added 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"
}