Get Friend List for Third-party Channel
POST /v2/friend/friend_list
This API enables the game to retrieve a player's friend list from a third-party channel.
Only Facebook, Garena, QQ, Steam, WeChat, and VK are currently supported. If the game has the multi-store package installed to avoid package overwriting for different storefronts, the Facebook and WeChat channels are restricted to retrieving the in-game friends under the same app ID.
For the rate limits of each channel, see Rate limit.
Request parameters
For query parameters, see Query parameters.
Parameter | Type | Description | Remark |
---|---|---|---|
openid | string | Unique user ID | Required |
token | string | User login state | Required |
Request sample
curl -sS -X POST -H 'Content-Type: application/json' 'https://test.intlgame.com/v2/friend/friend_list?channelid=21&gameid=11&os=5&source=0&ts=1590485133&sdk_version=2.0&sig=b0131f8a844dcdb1044a87ea2a6d5f0d' -d '{"token":"b71de93cc578b442f129e2aa445655828386fec9","openid":"5642128712278250897"}'
Response parameters
Parameter | Type | Description |
---|---|---|
ret | int | Return code 0: success others: failure |
msg | string | Response message |
lists | array | List of friends on the same third-party channel |
is_lost | int | When the value of is_lost=1, the obtained data is downgraded. Do not cache the data. If there is cached data, use the cached data first. The current data is only used when there is no cached data. |
seq | string | Serial number of request URL |
Lists description
lists {
string openid; // Unique user ID
string user_name; // User name
uint gender; // User gender. 1: Male; 2: Femal; 0: Undefined
string picture_url; // URL of user avatar
}
Response sample
{
"ret": 0,
"msg": "SUCCESS",
"is_lost": 0,
"lists": [
{
"openid": "9556832059718695202"
},
{
"openid": "6045537030682645917"
},
{
"openid": "8620320801333649204"
},
{
"openid": "18062972584926121462"
}
],
"seq": "1590992804-0266701833-005087-0000003295"
}
Rate limit
This API returns information that is filtered from the friend list returned by third-party APIs. Games should take note of the rate limits of the third-party channels, such as:
- Facebook: Calls within one hour = 200 * Number of Users
For more information, see Rate Limits. - VK:
- Maximum 3 requests to API methods per second from a client;
- Maximum amount of server requests depends on the amount of users:
- Less that 10,000 users, 5 requests per second;
- Up to 100,000 users, 8 requests per second;
- Up to 1,000,000 users, 20 requests per second;
- More than 1,000,000 users, 35 requests per second;
- For more information, see API Requests.
- Steam: Each app is limited to 100,000 calls to the Steam Web API per day
For more information, see Steam Web API Terms of Use.
Rate limits can change at any time. Always refer to the official documentation of the relevant channel for the latest restrictions.