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.
Attribute | Data type | Remarks | Description |
---|---|---|---|
openid | string | required | Unique user ID (up to 20 numeric characters) |
modify_ts | bigint | required | Timestamp of last update (in milliseconds) |
tags | []string | optional | Custom tags for the grouping of users, used in user segmentation:
|
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/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
Attribute | Data type | Description |
---|---|---|
code | int | Return code |
msg | string | Return message |
Response sample
{
"code": 0,
"msg": "Success",
"seq": "{YOUR_RANDOM_STRING}"
}