This API is used to obtain user attributes. To call this API, you must use the admin account. You can obtain a maximum of 100 users’ attributes at a time.You need to set the App attribute name before calling the API.
This feature can only be applied for by Ultimate Edition users (but not by Pro Edition users). You can apply for this feature by submitting a ticket, and we will evaluate your needs for approval. If we determine that this feature suits your needs, we will approve your application so that you can use the feature.
https://console.tim.qq.com/v4/all_member_push/im_get_attr?usersig=xxx&identifier=admin&sdkappid=88888888&random=99999999&contenttype=json
Parameter | Description |
---|---|
https | The request protocol is HTTPS, and the request method is POST. |
console.tim.qq.com | Fixed domain name |
v4/all_member_push/im_get_attr | Request API |
usersig | Signature generated by the app admin account. For more information, see the UserSig backend API. |
identifier | The value must be the app admin account. |
sdkappid | SDKAppID assigned by the IM console when the app is created |
random | A random 32-bit unsigned integer |
contenttype | Fixed value: JSON |
The maximum call frequency is 100 times per second.
{
"To_Account": [
"Zhang Xiaohong",
"Chen Xiaoming",
"abc"
]
}
Field | Type | Attribute | Description |
---|---|---|---|
To_Account | Array | Required | List of target user accounts |
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0,
"UserAttrs": [
{
"To_Account": "Zhang Xiaohong",
"Attrs": {
"sex": "Female",
"city": "New York"
}
},
{
"To_Account": "abc",
"Attrs": {}
},
{
"To_Account": "Chen Xiaoming",
"Attrs": {
"sex": "Male",
"city": "Shenzhen"
}
}
]
}
Field | Type | Description |
---|---|---|
ActionStatus | String | Processing result of the request. Valid values: OK for succeeded, and FAIL for failed |
ErrorCode | Integer | Error code |
ErrorInfo | String | Error information |
UserAttrs | Array | List of user tag content |
To_Account | String | User account |
Attrs | Object | Attribute content |
The HTTP return code for this API is always 200 unless a network error (such as error 502) occurs. The actual error code and error message are indicated by ErrorCode and ErrorInfo in the response packet, respectively. For public error codes 60000 to 79999, see Error Codes.
The error codes specific to this API are as follows:
Error Code | Description |
---|---|
90001 | Failed to parse the JSON format. To correct it, check whether the JSON request packet meets JSON specifications. |
90018 | The number of accounts requested exceeds the limit. |
91000 | An internal service error occurred. To correct it, try again. |
To debug this API, you can use the online debugging tool for RESTful APIs.
Was this page helpful?