SyncUserByEmail
Import contacts into SmartLink according to email address. If the contact already exists, update the contact information for that email.
POST /api/v3/userinfo/sync_user_by_email
Request parameters
For more information on the query parameters, see Query parameters.
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/sync_user_by_email?gameid=${GAME_ID}&seq=${YOUR_RANDOM_STRING}&sig=${SIGNATURE}&ts=${TS}" \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "545058834@qq.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"
},
"preferences": [
"option1","option2"
]
}'
Update strategy
The update strategy controls whether the imported contact information will be used to update the subscribe
field. While the attributes
field will still be updated for all imported contacts, adding the update_strategy
parameter to the request JSON will change the way subscribe
is updated for contacts with different subscription statuses.
Based on the value set for update_strategy
, the subscription status (subscribe
) of contacts that are not updated will remain the same, even if parameters have been received.
update_strategy = 0
or left blank:
Current subscription status | Whether to update |
---|---|
Subscribed | Yes |
Unsubscribed | Yes |
Non-subscribed | Yes |
Pending | No |
update_strategy = 1
:
Current subscription status | Whether to update |
---|---|
Subscribed | Yes |
Unsubscribed | Yes |
Non-subscribed | Yes |
Pending | Yes |
update_strategy = 2
:
Current subscription status | Whether to update |
---|---|
Subscribed | No |
Unsubscribed | No |
Non-subscribed | Yes |
Pending | No |
Response parameters
Attribute | Data type | Description |
---|---|---|
code | int | Return code |
msg | string | Return message |
Response sample
{
"code": 0,
"msg": "Success",
"seq": "{YOUR_RANDOM_STRING}"
}