BatchSyncUserByEmail
Bulk import contacts into SmartLink according to email address, and update the information for existing contacts. Limited to 200 contacts for each import.
POST /api/v3/userinfo/batch_sync_user_by_email
Request parameters
For more information on the query parameters, see Query parameters.
Attribute | Data type | Remarks | Description |
---|---|---|---|
users | []User | required | Bulk import contacts (up to 200 contacts per import) |
User
Attribute | Data type | Remarks | Description |
---|---|---|---|
string | required | ||
modify_ts | bigint | required | Timestamp of last update (in milliseconds) |
tags | []string | optional | Custom tags for the grouping of users, used in user segmentation:
|
openid | string | optional | Unique user ID (up to 20 numeric characters) |
subscribe | int | optional | User subscription status. 1: Subscribed, 0: Unsubscribed, -1: Non-subscribed |
location | string | optional | Three-digit country code, see number_code from Country or region informationIf the parameter is unknown or empty, the existing value will not be overwritten |
language | string | optional | Language code, see language_code from Language informationIf the parameter is unknown or empty, the existing value will not be overwritten |
attributes | object | optional | Custom user attribute. Supports updating other contact attributes, such as gender and birthday. Used in user segmentation, for the creation of personalized campaigns:
|
preferences | []string | optional | Attribute to determine a contact's subscription groups, which can be used to classify subscribers based on interests and subscriber preferences. Used in user segmentation, for sending targeted emails to users with specific subscriber preferences:
|
update_strategy | int | optional | Controls whether the subscribe field is updated, see Update strategy for more details. |
Request sample
curl --request POST "https://openapi.smartlink.intlgame.com/api/v3/userinfo/batch_sync_user_by_email?gameid=${GAME_ID}&seq=${YOUR_RANDOM_STRING}&sig=${SIGNATURE}&ts=${TS}" \
--header 'Content-Type: application/json' \
--data-raw '{
"users":[
{
"email": "example@smartlink.intlgame.com",
"modify_ts": 1691225447577,
"tags": [
"tag1","tag2"
],
"openid": "5450588341569",
"subscribe": 1,
"location": "004",
"language": "en",
"attributes": {
"nickname": "tang",
"level": "10",
"birthday":"1990-05-09 00:00:00+08:00",
"prop":["option1","option2"]
},
"preferences": [
"option1","option2"
]
},
{
"email": "example1@smartlink.intlgame.com",
"modify_ts": 1691225447577,
"tags": [
"tag3","tag4"
],
"openid": "5450588341579",
"subscribe": 1,
"location": "004",
"language": "en",
"attributes": {
"nickname": "tang2",
"level": "19",
"birthday":"1990-05-09 00:00:00+08:00",
"prop":["option1","option2"]
},
"preferences": [
"option1","option2"
]
}
]
}'
Response parameters
属性 | 数据类型 | 描述 |
---|---|---|
code | int | Return code |
msg | string | Return message |
data | []ErrorUsers | Error message array, returns all errors after aggregation if the request parameter has multiple errors |
ErrorUsers
属性 | 数据类型 | 描述 |
---|---|---|
req_index | int | Array index of the request parameter |
string | ||
errors | []Error | Error message array |
Error
属性 | 数据类型 | 描述 |
---|---|---|
code | int | Return code |
msg | string | Return message |
Response sample
{
"code": 0,
"msg": "Success",
"data": {
"error_users": [
{
"req_index": 0,
"email": "example@smartlink.intlgame.com",
"errors": [
{
"code": 17001,
"msg": "tag is not exist :tag1"
},
{
"code": 17001,
"msg": "tag is not exist :tag2"
}
]
}
]
},
"seq": "{YOUR_RANDOM_STRING}"
}