AddAttributesByOpenID
Add custom attributes to contacts according to OpenID. Ensure that imported attributes have been created in SmartLink > All contacts > Attribute settings.
POST /api/v3/userinfo/add_attributes_by_openid
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) | 
| attributes | object | required | Custom user attribute. Supports updating other contact attributes, such as gender and birthday. Used in user segmentation, for the creation of personalized campaigns: 
 
 | 
| update_strategy | int | optional | Controls whether the subscribefield is updated, see Update strategy for more details. | 
Request sample
curl --request POST "https://openapi.smartlink.intlgame.com/api/v3/userinfo/add_attributes_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,
    "attributes": {
        "nickname": "tang",
        "level": "10",
        "birthday": "1990-05-09 00:00:00+08:00",
        "prop":["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}"
}