Skip to main content

AddAttributesByEmail

Add custom attributes to contacts according to email address. Ensure that imported attributes have been created in SmartLink > All contacts > Attribute settings.

POST /api/v3/userinfo/add_attributes_by_email

Request parameters

For more information on the query parameters, see Query parameters.

AttributeData typeRemarksDescription
emailstringrequiredEmail
modify_tsbigintrequiredTimestamp of last update (in milliseconds)
attributesobjectrequiredCustom 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"]
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/add_attributes_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,
"attributes": {
"nickname": "tang",
"level": "10",
"birthday": "1990-05-09 00:00:00+08:00",
"prop":["option1","option2"]
}
}'

Response parameters

AttributeData typeDescription
codeintReturn code
msgstringReturn message

Response sample

{
"code": 0,
"msg": "Success",
"seq": "{YOUR_RANDOM_STRING}"
}