https://xxxxxx/v4/sns/friend_get_list?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
Parameter | Description |
xxxxxx | Domain name corresponding to the country/region where your SDKAppID is located. China: console.tim.qq.com Singapore: adminapisgp.im.qcloud.com Seoul: adminapikr.im.qcloud.com Frankfurt: adminapiger.im.qcloud.com Silicon Valley: adminapiusa.im.qcloud.com Jakarta: adminapiidn.im.qcloud.com |
v4/sns/friend_get_list | Request API |
sdkappid | SDKAppID assigned by the Chat console when an app is created |
identifier | |
usersig | |
random | A random 32-bit unsigned integer ranging from 0 to 4294967295. |
contenttype | Request format, which should always be json . |
{"From_Account":"UserID_1","To_Account":["UserID_2"],"TagList":["Tag_Profile_Custom_Test","Tag_Profile_IM_Image","Tag_Profile_IM_Nick","Tag_SNS_Custom_Test","Tag_SNS_IM_Remark","Tag_SNS_IM_Group"]}
{"From_Account":"UserID_1","To_Account":["UserID_2","UserID_3","UserID_4"],"TagList":["Tag_Profile_Custom_Test","Tag_Profile_IM_Image","Tag_Profile_IM_Nick","Tag_SNS_Custom_Test","Tag_SNS_IM_Remark","Tag_SNS_IM_Group"]}
Field | Type | Required | Description |
From_Account | String | Yes | The UserID of the account that requests to pull friend data. |
To_Account | Array | Yes | The list of friend UserIDs. We recommend that you pull no more than 100 friends at a time to avoid response packet failure due to excessive data volume. |
TagList | Array | Yes | This specifies the following profile fields and friend fields to be pulled: |
{"InfoItem": [{"To_Account": "UserID_2","SnsProfileItem": [{"Tag": "Tag_SNS_IM_Remark","Value": "remark_2"},{"Tag": "Tag_SNS_IM_Group","Value": ["group1","group2"]},{"Tag": "Tag_Profile_IM_Nick","Value": "nick_2"},{"Tag": "Tag_SNS_Custom_Test","Value": "custom_sns_2"},{"Tag": "Tag_Profile_Custom_Test","Value": "custom_profile_2"}],"ResultCode": 0,"ResultInfo": ""}],"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","ErrorDisplay": ""}
{"InfoItem": [{"To_Account": "UserID_2","SnsProfileItem": [{"Tag": "Tag_SNS_IM_Remark","Value": "remark_2"},{"Tag": "Tag_SNS_IM_Group","Value": ["group1","group2"]},{"Tag": "Tag_Profile_IM_Nick","Value": "nick_2"},{"Tag": "Tag_SNS_Custom_Test","Value": "custom_sns_2"},{"Tag": "Tag_Profile_Custom_Test","Value": "custom_profile_2"}],"ResultCode": 0,"ResultInfo": ""},{"To_Account": "UserID_3","SnsProfileItem": [{"Tag": "Tag_SNS_IM_Remark","Value": "remark_3"},{"Tag": "Tag_Profile_IM_Nick","Value": "nick_3"},{"Tag": "Tag_Profile_Custom_Test","Value": "custom_profile_3"}],"ResultCode": 0,"ResultInfo": ""},{"To_Account": "UserID_4","ResultCode": 30001,"ResultInfo": "Err_SNS_FriendGetList_Friend_Not_Exist"}],"Fail_Account": ["UserID_4"],"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","ErrorDisplay": ""}
Field | Type | Description |
InfoItem | Array | Friend object array. Each friend object contains a To_Account field and a SnsProfileItem array. |
To_Account | String | UserID of a friend |
SnsProfileItem | Array | Array for storing friend data. Each array element contains a Tag field and a Value field. |
Tag | String | Field name |
Value | String/Integer/Array | Field value |
ResultCode | Integer | The result of To_Account . 0 : Successful. Other values: Failed. For details on non-zero results, see Error Codes. |
ResultInfo | String | The error description of To_Account . This field is empty if the request succeeds. |
Fail_Account | Array | List of UserIDs that failed to be verified. This field is only returned when at least one user fails. |
ActionStatus | String | Request result. OK : Successful; FAIL : Failed |
ErrorCode | Integer | |
ErrorInfo | String | Detailed error information |
ErrorDisplay | String | Detailed information displayed on the client |
ResultCode
, ResultInfo
, ErrorCode
, and ErrorInfo
.
For public error codes (60000 to 79999), see Error Codes.
The following table describes the error codes specific to this API:Error Code | Description |
30001 | Incorrect request parameter. Check your request according to the error description. |
30003 | The requested account does not exist. |
30004 | The request requires app admin permissions. |
30006 | Internal server error. Try again. |
30007 | Network timeout. Try again later. |
この記事はお役に立ちましたか?