Skip to main content

UpdateUserByOpenID

Update contact information according to OpenID.

POST /api/v3/userinfo/update_user_by_openid

note

OpenID refers to the unique identifier of a user in a specific authentication system. Before performing the update, verify that the obtained OpenID is correct before proceeding, or the wrong information may be modified.

Request parameters

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

AttributeData typeRemarksDescription
openidstringrequiredUnique user ID (up to 20 numeric characters)
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.
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/update_user_by_openid?gameid=${GAME_ID}&seq=${YOUR_RANDOM_STRING}&sig=${SIGNATURE}&ts=${TS}" \
--header 'Content-Type: application/json' \
--data-raw '{
"openid": "1012156612344364",
"modify_ts": 1691225447577,
"tags": [
"tag1","tag2"
],
"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"
]
}'

Response parameters

AttributeData typeDescription
codeintReturn code
msgstringReturn message

Response sample

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