Skip to main content

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.

AttributeData typeRemarksDescription
users[]UserrequiredBulk import contacts (up to 200 contacts per import)

User

AttributeData typeRemarksDescription
emailstringrequiredEmail
modify_tsbigintrequiredTimestamp of last update (in milliseconds)
tags[]stringoptionalCustom tags for the grouping of users, used in user segmentation:
  • Ensure the imported tags have been created in SmartLink > Contacts > Tag management, else the update will fail.
  • Tags can only be added, existing tags will not be overwritten.
  • Each user can be associated with up to 100 tags.
openidstringoptionalUnique user ID (up to 20 numeric characters)
subscribeintoptionalUser subscription status.
1: Subscribed, 0: Unsubscribed, -1: Non-subscribed
locationstringoptionalThree-digit country code, see number_code from Country or region information
If the parameter is unknown or empty, the existing value will not be overwritten
languagestringoptionalLanguage code, see language_code from Language information
If the parameter is unknown or empty, the existing value will not be overwritten
attributesobjectoptionalCustom user attribute. Supports updating other contact attributes, such as gender and birthday.
Used in user segmentation, for the creation of personalized campaigns:
  • Ensure the imported attributes have been created in SmartLink > All Contacts > Attribute settings, else the update may fail.
  • User attributes can only be added or updated, existing attributes will not be overwritten if not included in the update.
  • Each user can have a total of up to 50 custom attributes.
attributes type and format:
  • Text type: formatted as { "key":"value" }
    - key: attribute name
    - value: string, cannot exceed 1000 characters
  • Number type: formatted as { "key":"value" }
    - key: attribute name
    - value: string, between -9223372036854775808 and 9223372036854775807
  • Date type: formatted as { "key":"value" }
    - key: attribute name
    - value: string, date formatted as 2001-03-31+08:00 or 2001-03-31 00:00:00+08:00
  • Drop down type: formatted as { "key":["value"] }
    - key: attribute name
    - value: []string, each string cannot exceed 1000 characters, such as ["option1","option2"]
preferences[]stringoptionalAttribute 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:
  • Ensure the imported subscription groups have been created in SmartLink > Contacts > Preferences, else the update will fail.
  • The lastest subscriber preferences set by the user will take precedence, and is not affected by the user subscription status.
  • Each user can have up to 20 subscription groups selected.
update_strategyintoptionalControls 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

属性数据类型描述
codeintReturn code
msgstringReturn message
data[]ErrorUsersError message array, returns all errors after aggregation if the request parameter has multiple errors

ErrorUsers

属性数据类型描述
req_indexintArray index of the request parameter
emailstringEmail
errors[]ErrorError message array

Error

属性数据类型描述
codeintReturn code
msgstringReturn 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}"
}