05/15/2024 15:19:45

Friend Relationship

I. Friend relationship (game friends, not including the player himself)

QQ/ WeChat channels need to go to the platform to apply for the relationship permission if they want to draw the friend relationship. In order to facilitate games to access the platform, Feiying integrates a pathway for quick permission application: Feiying system -> SDK Access on the Left Menu -> Special Permission Application -> QQ Relationship / WeChat Relationship.

1.1 Interface Name

/v2/friend/friend_list

1.2 Request Parameters

Parameters Type Description
openid string [Required] the user's unique identifier
token string [Required] the user's login state
sub_channelid int [Optional] The parameter is passed in when the player queries the in-game friends of other channels bound to the current account. It is used to specify the channel needed to be queried. As for its value, please refer to the general description of the backend

1.3 Return Parameters

Parameters Type Description
ret int return code 0: correct, others: failure
msg string The detailed description of the return result
lists array The game friend's personal information list
is_lost int Only QQ channels need to note:
If the value is 0, it indicates that the friend data returned by QQ is normal. The game can directly use the returned friend data;
When the value is 1, it means a downgraded scheme of QQ, indicating that the acquired data is incomplete. If the game accepts the downgrade, it can choose to use incomplete data, otherwise it can be regarded as failure;

lists description

Lists {
    String openid; // user identifier
    String user_name; // nickname
    Int gender; // Gender, undefined-0, male-1, female-2 QQ channels always return 0,WeChat does not support this field
    String picture_url; //
    String country; // country,WeChat does not support this field
    String provice; // province
    String city; // city
    String language; // language
    string nick_name;       //(Only supported by WeChat) As for the nickname of a friend in the social channel, it is needed to confirm the existence of the field before taking its value, because the field exists only when the permission is normal and WeChat returns the nickname normally.
    string friend_remark;   //((Only supported by WeChat) As for the remark name of a friend, it is needed to confirm the existence of the field before taking its value, because the field exists only when the permission is normal and WeChat returns the nickname normally.
}

Note

  • user_name will be managed according to the strategy at any time. If there is a clear need to use a WeChat remark name, please be sure to get it through friend_remark; For games newly connecting to MSDK, user_name only returns the nickname by default;
  • For new games, the nickname should use the nick_name field. If you need friend remarks, you need to go through the application and reporting process to confirm the compliance of the friend remarks before using the friend_remark field;
  • QQ friend avatar URL; parameter /40 or /100 must be appended to the rear of the URL. In this way, an image with a specification of <40*40> (/40) or <100*100> (/100) can be obtained, respectively;
  • WeChat friend avatar URL; the parameter /0, /46, /64, /96 or /132 must be appended to the rear of the URL. In this way, an original image with a specification of (/0), <46*46> (/46), <64*64> (/64), <96*96> (/96) or <132*132> (/132) can be obtained, respectively;
  • For overseas channels such as Facebook, in order to make exported games meet GDPR regulations, the gender information of a friend is fixed to return 0;
  • When there are no in-game friends, it is normal that there is no 'lists' field in the reply packet;

1.4 Request example

WeChat channel

  • Request
      {
          "openid": "13601369187816917176",
          "token": "61_nTO2IrYUm4KTM58tuZYZR8wZMbjyDJWndI_AMzuIKjAOGDobd94FtNLaiH8KmB774Q40xDo14hjnmHi_mZocsuACKV3GVps7gPXr-glx4Ts"
      }
    
  • Response
      {
          "ret": 0,
          "msg": "",
          "lists": [
              {
                  "user_name": "zzz",
                  "picture_url": "https://wx.qlogo.cn/mmhead/No0JxNE4LEUcXM5dmgJcjEadU8jllM45SGtOHxsmiafM",
                  "provice": "",
                  "openid": "6292984005760995448",
                  "nick_name": "Σ( ̄。 ̄ノ)ノ",
                  "friend_remark": "Xiao Zhang"
              },
              {
                  "user_name": "Xiao Jia",
                  "picture_url": "https://wx.qlogo.cn/mmhead/Zc9yUpJNc2MVN3IzgUtL9BsfA09pp4MSaaib8nSDb03M",
                  "provice": "",
                  "openid": "18182179939911361117",
                  "nick_name": "Xiao Jia"
              }
          ],
          "seq": "1664333165-3965425163-019804-0315511573"
      }
    

QQ channel

  • Request

      {
          "openid":"4724195171999796436",
          "token":"27A50B44430AAD6BFFBE09BA875E48BB"
      }
    
  • Response
      {
          "ret": 0,
          "msg": "",
          "lists": [
              {
                  "user_name": "Xiao Zhang",
                  "gender": 0,
                  "picture_url": "https://q.qlogo.cn/qqapp/1106977030/A7DB20EFF6DD4A617367B71186DB33A6/",
                  "openid": "14882639338379730531"
              },
              {
                  "user_name": "Xiao Jia",
                  "gender": 0,
                  "picture_url": "https://thirdqq.qlogo.cn/qqopen/ZdvYp9s7k6qJuCiaNlJR3hT5vtL0rJxiclJ814gxnmuKYXv0xs04j1WWUoKX1u1MlE/",
                  "openid": "15991060247728890761"
              }
          ],
          "is_lost": 0,
          "seq": "1664333315-0844862987-022347-0109203549"
      }
    

II. Get unregistered QQ friends / WeChat confidants

2.1 Interface name

/v2/friend/recall_friends_list

2.2 Interface Description

Important: Get unregistered QQ friends/WeChat friends (relationship promoter capability). Unauthorized user data can be obtained when this interface is invoked in the game. After being evaluated by "Personal Information Protection Law", the interface needs to be modified. Project teams that have accessed and used this interface should pay attention to this. For games not accessing the interface, application for accessing it is suspended now.

① Platform transformation plan: In the game, the interface will return an empty data: "No recommended friends". Project teams should pay attention to the user interface processing. If necessary, it is needed to hide the UI portal of using unregistered friends/promoters in the game.

② Effective time: Before 18:00 on November 5, 2021.

For details about QQ platform's Notice module, please consult qqconnecthelper (QQ-Connect and login consultation);
For details about WeChat platform's Notice module, please consult wxgame or refer to https://mmgame.oa.com/index.html#/announce/detail?id=174.

2.3 Request parameters

Parameter Type Description
openid string [Required] the user's openid
token string [Required] the user's token
task_id int [Required for WeChat] task id; obtained when applying from WeChat
count int [Required for QQ] For the expected number of friends drawn, it is recommended to fill in 20 (do not exceed 20 because SDK returns up to 20 friends)

2.4 Return parameters

Parameter Type Description
ret int Return code: 0: success, others: failure
msg string Return Information
result object Return result object, which is described for WeChat and QQ, respectively
  • WeChat result structure
Parameter Type Description
friend_list array List of confidants
model_id int model id
send_list array The delivery list
  • QQ result structure
Parameter Type Description
friend_list array List of unregistered friends
  • Each object in the friend_list list contains three fields: sopenid, head_img_url, nick_name

2.5 Request example

# WeChat    
curl -X POST -H 'Content-Type: application/json' 'https://test.itop.qq.com/v2/friend/recall_friends_list?channelid=1&conn=&gameid=12&os=1&seq=&source=0&ts=1570764309&version=2.0&sig=cae2c68c247db13d0d9e111f90f0eb54' -d '{"openid":"3505996091832136773","token":"26_cUcJse2lEvZP9SojX5Oc-EKdaFV96i-sMOOCL3OB_fMSiwmq6wjC4e3tOj_zW7f8U3j8BAqBjwNaJPdR70U76B-hRkkgs1CMcVhLLiVj86U","task_id":0}'
{    
    "msg": "success",    
    "result": {    
        "friend_list": [    
            {    
                "sopenid": "sHlap1bakvTsj1fyeeWxPoIW5OiY",    
                "head_img_url": "http://wx.qlogo.cn/mmopen/vi_32/298Iynvq8598KfjWKRxHX0w2P1icnoE1mnj6BlOBicEOAoG6qbl6oD6Csumiaq2LFIsiat5ZZAsN95SRDULfoiaob4g/0",    
                "nick_name": "Gong Chang Yue Ban Yue Ban"    
            },    
            {    
                "sopenid": "sHlap1V3R7QDESg-WgyRfXI5ZKcI",    
                "head_img_url": "http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIAmxdv26icib4TayhbZqqdJ49Zvwicukf8vJw6zCgPdDAYxMEG37tkkmg54Y8zrObeFCKpKMcRaMGzg/0",    
                "nick_name": "Lin"    
            }    
        ],    
        "model_id": 0,    
        "send_list": []    
    },    
    "ret": 0,    
    "seq": "1570770148-0268717065-046971-0000003701"    
}
# QQ    
curl -X POST -H 'Content-Type: application/json' 'https://test.itop.qq.com/v2/friend/recall_friends_list?cgsource=cloudgame&channelid=2&conn=&gameid=12&os=1&seq=&source=0&ts=1572523399&version=2.0&sig=a8598291194154e79cb6b7c0a6f40e55' -d '{"token":"D46EF700A328F58231FF69045A54C91D","openid":"15879468368890148661","count":20}'
{    
    "msg": "success",    
    "ret": 0,    
    "result": {    
        "friend_list": [    
            {    
                "sopenid": "ChBBXeAbRjqUbDa8zZ8K_A1oNBKBAWK9mxgNDNwJIxBYd6IWho2aWtjfbWqkjpi7",    
                "nick_name": "He Miao Miao Taro",    
                "head_img_url": "https://thirdqq.qlogo.cn/qqapp/1106977030/B784C3A8411A406546E40DCD9D898635/100"    
            },    
            {    
                "sopenid": "NYcNfgzl7EIk5d96VCJOYJtHI3wYf0qUOqG5X8ilZGW8lMlr2v0QtXUkcXQrH4d3",    
                "nick_name": "Operation Development-Jiang Huiqiang",    
                "head_img_url": "https://thirdqq.qlogo.cn/qqapp/1106977030/255E40A981DF206E75975A7440098C1D/100"    
            },    
            {    
                "sopenid": "ajOYNtR74_zxjXaKF6h-0GuOCNhXuCrtGS_ADdx3D_V-9Jb_wsQOvYbHjUXZaCUs",    
                "nick_name": "Nasda α",    
                "head_img_url": "https://thirdqq.qlogo.cn/qqapp/1106977030/DF5130F8023DFE197B121346B10EB9FA/100"    
            },    
            {    
                "sopenid": "P61CN9sYPuDO05-ydiefCUGYKGzPE8avgAhhMVlUBQVu7-VAq1CclagM2qo5f_R8",    
                "nick_name": "Wang Zhibo",    
                "head_img_url": "https://thirdqq.qlogo.cn/qqapp/1106977030/56ED3920969AFAD056EB83A323B1155D/100"    
            }    
        ]    
    },    
    "seq": "1572525472-0016777343-022540-0000000191"    
}
  • Note
    • To call the WeChat confidant interface, it is needed to apply for permission. For WeChat confidant documentation, please refer to: https: //mmgame.oa.com/doc/#/article/144;
    • Permission application process
      1. Game products can refer to the template in "WeChat confidant documentation" to send application via email;
      2. The development team initiates an online application (https://weixin.oa.com/open_broker/). This application requires the approval of the directors of both parties
      3. As for the test environment calling interface, currently need to contact @mmgame_helper (WeChat game development assistant) for appid synchronization (formal environment binding requires the game to contact cooperative operation after pr1)

III. Get sopenid(Only supported by QQ and WeChat channels)

3.1 Interface name

/v2/profile/get_sopenid

3.2 Request parameters

Parameter Type Description
openid string [Required] the user's openid
token string [Required] the user's token

3.3 Return parameters

Parameter Type Description
ret int Return code: 0: success, others: failure
msg string Return Information
result object Return result object, which is described for WeChat and QQ, respectively

3.4 demo

# WeChat    
curl -X POST -H 'Content-Type: application/json' 'https://test.itop.qq.com/v2/profile/get_sopenid?channelid=1&conn=&gameid=12&os=1&seq=&source=0&ts=1572523399&version=2.0&sig=b7724e08bc2627576391104c340df9bd' -d '{"token":"27_l7XUrQiS8dyqIA4vGGqfjJsVwVBl0EKl30kaArFK6ALSPRXseyJsDw2qZDd6Hl6UgvsLhe5cLEL2aJ5_j5Od1JrEaFwMOIOQ9aAd578sfyQ","openid":"3505996091832136773"}'
{"ret":0,"msg":"success","sopenid":"sHlap1b2ZKIs92noWooBci31u9Y8","seq":"1572525723-0016777343-022546-0000000075"}
# QQ    
curl -X POST -H 'Content-Type: application/json' 'https://test.itop.qq.com/v2/profile/get_sopenid?channelid=2&conn=&gameid=12&os=1&seq=&source=0&ts=1572523399&version=2.0&sig=074133c7f08e4b0320aee6584e244e49' -d '{"token":"D46EF700A328F58231FF69045A54C91D","openid":"15879468368890148661"}'
{"ret":0,"msg":"success","sopenid":"ikrjDgPqEUPTY_jnBKx9w5NZAkOimlyv-Tzl2Cj0gEFCtDHY_KjzRQBD9CuufGrM","seq":"1572525777-0016777343-022540-0000000192"}

IV. Share

4.1 Interface name

/v2/friend/share

4.2 Access instructions

The interface on the platform side no longer accepts the game's access to ARK backend sharing. If you have special needs, please contact QQ Game Center (games which have accessed the interface can continue to use it).

4.3 interface description

The structured message /ARK message shared by QQ back-end sharing can be received through C2C(Apply for 'sceneid' on the Oasis platform to send messages, To use ARK type, it is recommended to call /v2/friend/ark_share ). In addition, you can also receive sharing messages through "QQ Mobile Games" public account, but you need to follow the public account in advance.

The shared content can only be seen on mobile phone QQ, but cannot be seen on PC QQ.

Restrictions on sending and receiving messages:
1.Structured message
The same pair of numbers send and receive messages to each other. The number of interactions is once a day.
On the receiving side, the same user can receive up to 5 pieces of message per day and up to 20 pieces per week.
Sender: the same user sends messages to different users every day, up to 10 pieces a day and up to 40 pieces a week to a user.
2.ark message
The receiver can receive up to 5 pieces of message per day and up to 3 pieces of message from the same person.
The sender can send up to 30 pieces of message per day and up to 100 pieces of message per week.

Messages received through the public account of "QQ Mobile Games" will be delivered on the platform side with a delay and will be delivered at three fixed time periods a day (currently at 12:00, 20:00 and 22:00 every day) through the public account. A single user can receive up to 3 pieces of public account messages a day.

4.4 Request parameters

Parameter Type Description
openid string [Required] The user's unique identifier
token string [Required] the user's login status
type int [Required] just fixedly filled with 20000
fopenid string [Required for in-game friends] in-game friend's openid
sopenid string [Required for inviting unregistered friends] Unregistered friend's sopenid (obtained via the /v2/friend/recall_friends_list interface)
title string Title
desc string Abstract
link string Used for sharing links [not support link sharing now]
image_url string [QQ sharing] the sharied image's url
game_tag string [Required] It is assigned by the platform side. Before filling in it, you need to communicate with QQ platform (only some reference values are listed below):
1. Receive the push message via public account
"MSG_INVITE": invitation;
"MSG_FRIEND_EXCEED": Show off exceeding;
"MSG_HEART_SEND": Send a heart;
"MSG_SHARE_FRIEND_PVP": PVP battle;
2. Receive structured messages via C2C push
"MSG_RECALL": Recall;
"MSG_INVITE_NEW": Invite;
3. Ark message
"MSG_RECALL_ARK": Recall;
" MSG_INVITE_ARK": Invite;
"MSG_INVITE_FRIEND_ARK": Make new friends;
channel_info object Channel information
extra string Other extension information

channel_info field

QQ Channel

Parameter Type Description
act int launch a game: 1
target_url string The Game Center's details page URL; the user-defined information can realize transparent transmission by adding the 'gamedata' parameter behind URL, such as: https: //speed.gamecenter.qq.com/pushgame/v1/detail?appid=xxx&gamedata=gamedata
src int [Used for QQ sharing] the source of information; defaulted as 0
dst int [Used for QQ sharing] only filled with 1001
flag int [Used for QQ sharing] Roaming, only filled with 1

4.4 Request return

Parameter Type Description
ret int Return code; 0: correct; others: failed
msg string Detailed description of the return result
seq string seq field in the request's url

4.5 demo

  • Request URL

      http://hktest.itop.qq.com/v2/friend/share?channelid=2&gameid=11&os=1&platform=2&seq=123&ts=1530792639&version=&sig=f544c40d50c28f4094aabd2d6638a9a3
    
  • Request Body

      {    
          "openid": "4724195171999796436",    
          "token": "27A50B44430AAD6BFFBE09BA875E48BB",    
          "fopenid": "4124157778415485412",    
          "title": "test_share",    
          "desc": "nothing to share",    
          "link": "",    
          "image_url": "http://mat1.gtimg.com/www/images/qq2012/erweimaNewsPic.png",    
          "game_tag": "",    
          "type": 20005,    
          "channel_info": {    
              "target_url": "http://mat1.gtimg.com/www/images/qq2012/erweimaNewsPic.png",    
              "dst": 1001,    
              "src": 0,    
              "flag": 1    
          }    
      }
    
  • Response

      {    
          "ret": 0,    
          "msg": "success!",    
          "seq": "123"    
      }
    

V. QQ ARK back-end sharing (only supported by QQ channel)

5.1 Interface name

/v2/friend/ark_share

5.2 Access description

The QQ ARK sharing service interface provides ARK message C2C sharing capability (share messages to QQ friends in the smartphone and display them in the friends session box). Apply for 'sceneid' on the Oasis platform and send ARK type message. For the following procedures, you need to contact the Tencent contact person:
(1) The access party contacts the QQ platform operation staff to input the information, and the QQ platform operation staff submits the information to the platform's process team to input it;
(2) After the interface access is completed, verify whether the sharing is successful.

-QQ side interface documentation description
-QQ side sharing template query link

5.3 Interface description

1.The shared content can only be seen on mobile QQ, not on PC QQ.
2.Restrictions on sending and receiving messages: the receiver:
The receiver can receive up to 5 pieces of message per day and up to 3 pieces of message from the same person.
The sender can send up to 30 pieces of message per day and up to 100 pieces of message per week.
3.QQ sharing provides a new access process. Refer to the documentation: http://km.oa.com/group/39817/articles/show/442477

5.4 Request parameters

Parameter Type Description
openid string [Required] The ID of the user who sends the shared message
token string [Required] The login status token of the user who sends the shared message
fopenid string [Required for in-game friends] The openid of the in-game friend who receives the shared message
sopenid string [Required for inviting unregistered friends] The unregistered friend's sopenid (obtained via /v2/friend/recall_friends_list interface)
extra string [Required] Transmit the sharing template extraJson of the QQ side, remove Json's comments and blanks. It is needed to urlencode the return parameter

Description:
extraJson can be gotten after the application for access to the ARK sharing process on the QQ side is completed. When using this parameter, you need to remove the comments and blanks of the json string, compress it into a string and then perform url encode to encrypt it.

5.5 Request's return parameters

Parameter Type Description
ret int Return code 0: successful, others: failed
msg string Detailed description of the returned result

5.6 Request example

  • Request URL

      https://itop.qq.com/v2/friend/ark_share?channelid=2&conn=&gameid=12&os=1&seq=1111-001&source=1&ts=1605081818&version=2.0&sig=62993d6c7f03f3e5c24fe5bb7ab06091
    
  • Request Body

     {
       "openid": "6703731585054734300",
      "token": "17DD31B2CC12B2A078B8CE4A7333B7FA",
      "fopenid": "14719294144616908484",
      "extra": "%7B%22app%22%3A%22com.tencent.gamecenter.qqsy%22%2C%22view%22%3A%22picView2%22%2C%22desc%22%3A%22%E6%B8%B8%E6%88%8F%E5%88%86%E4%BA%AB%22%2C%22ver%22%3A%221.0.0.1%22%2C%22config%22%3A%7B%22forward%22%3A0%2C%22type%22%3A%22normal%22%7D%2C%22meta%22%3A%7B%22shareData%22%3A%7B%22appid%22%3A%221109719108%22%2C%22openId%22%3A%22%22%2C%22scene%22%3A%22446%22%2C%22url%22%3A%22%22%7D%7D%7D"
     }
    
  • Response

      {
          "ret": 0,
          "msg": "success!",
          "seq": "1594899989-0268717065-054062-0000016317"
      }
    



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""