Contact
IMPORTANT!
Server Key ID and Server Key Secret will be used to construct a request and add as a HTTP Header. To construct a request, please format your generated Server Key ID and Server Key Secret and wrap it to Base64, so the format will be like this:
encodeToBase64(SERVER_KEY_ID:SERVER_KEY_SECRET) *don't forget to add colon (:) between Server Key ID and Server Key Secret
Then, put the base64 string on your HTTP Header Field with key “Server-Key” and then construct URL request and parameter for the request.

Sync Contacts

Update and/or delete contacts.
Note that contact works one-way. A user may add another user to his/her contact list without requiring the added user to do the same in return. It works just like how a contact/phone book should.
IMPORTANT!
Contact deletion always run the last. If the contact list contains duplicate owner-contact pairs with one's isDeleted set to true, then that record will always be deleted.
POST
1
BASE_URL/v1/server/contact/sync
2
3
example:
4
https://taptalk.io/v1/server/contact/sync
Copied!

Request

Field
Type
Description
contacts
string
(101) The list of contacts to be synced.
ownerXCUserID
string
(102) The XC user ID who owns the contact.
contactXCUserID
string
(103) The contact's XC user ID.
isDeleted
string
(104) If the contact is to be deleted, may be omited if false.
Request Example
1
{
2
"contacts": [
3
{
4
"ownerXCUserID": "1",
5
"contactXCUserID": "2"
6
},
7
{
8
"ownerXCUserID": "1",
9
"contactXCUserID": "6",
10
"isDeleted": false
11
},
12
{
13
"ownerXCUserID": "1",
14
"contactXCUserID": "9",
15
"isDeleted": true
16
},
17
{
18
"ownerXCUserID": "6",
19
"contactXCUserID": "1",
20
"isDeleted": false
21
}
22
]
23
}
Copied!

Success 200

Field
Type
Description
countInserted
long
Number of contact rows inserted.
countDeleted
long
Number of contact rows deleted.
Success Response
1
{
2
"status": 200,
3
"error": {
4
"code": "",
5
"message": "",
6
"field": ""
7
},
8
"data": {
9
"countInserted": 3,
10
"countDeleted": 1
11
}
12
}
Copied!

Error 4xx

Name
Description
ParamValidationFailed
The parameter validation failed.
HeaderValidationFailed
The request header validation failed.
ParamValidationFailed
1
{
2
"status": 400,
3
"error": {
4
"code": "40002",
5
"message": "Param 'contacts' cannot be empty",
6
"field": "101"
7
},
8
"data": {}
9
}
Copied!
HeaderValidationFailed
1
{
2
"status": 400,
3
"error": {
4
"code": "40001",
5
"message": "Request headers are required (Server-Key)",
6
"field": ""
7
},
8
"data": {}
9
}
Copied!
Last modified 1yr ago