Each app can set a maximum of 10 custom user attributes. This API is used to set the name of each attribute. After you set them, attribute names can be used for push by user attribute and other purposes.
The feature is available only to users with Flagship edition accounts. See Configuration Change Ticket to apply for this feature. The feature will be enabled 48 hours after your application is approved.
https://xxxxxx/v4/all_member_push/im_set_attr_name?usersig=xxx&identifier=admin&sdkappid=88888888&random=99999999&contenttype=json
Parameter | Description |
---|---|
https | The request protocol is HTTPS, and the request method is POST. |
xxxxxx | The country/region where your SDKAppID is located.console.tim.qq.com adminapisgp.im.qcloud.com adminapikr.im.qcloud.com adminapiger.im.qcloud.com adminapiind.im.qcloud.com |
v4/all_member_push/im_set_attr_name | Request API |
usersig | The signature generated by the app admin account. For more information, see UserSig backend API. |
identifier | It must be the app admin account. |
sdkappid | The SDKAppID assigned by the IM console when the app is created. |
random | A random 32-bit unsigned integer. |
contenttype | Fixed value: JSON |
100 times/second
Set attribute 0 of the app to “sex”, attribute 1 to “city”, and attribute 2 to “country”.
{
"AttrNames": {
"0": "sex",
"1": "city",
"2": "country"
}
}
Field | Type | Required | Description |
---|---|---|---|
Digital key | String | Required | Indicates the specific attribute (“0” to “9”). |
Attribute name | String | Required | The attribute name cannot exceed the length limit of 50 bytes. An app can have a maximum of 10 push attributes (numbered from 0 to 9), and users can customize the meaning of each attribute. |
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0
}
Field | Type | Description |
---|---|---|
ActionStatus | String | The processing result of the request. OK: succeeded. FAIL: failed. |
ErrorCode | Integer | Error code |
ErrorInfo | String | Error information |
The HTTP return code for this API is 200 unless a network error such as error 502 occurs. The actual error code and error information are indicated by ErrorCode and ErrorInfo in the response packet. For public error codes 60000 to 79999, see Error Codes.
The list below contains only error codes specific to this API:
Error Code | Description |
---|---|
90001 | Failed to parse the JSON format. Check whether the JSON request packet meets JSON specifications. |
90009 | The request requires the app admin’s permissions. |
91000 | An internal service error occurs. Please try again. |
To debug this API, you can use the Online RESTful API Debugging Tool.
Was this page helpful?