01/10/2025 10:53:00
Account Exchange
I. Query Third-party Channel's Account Id
1.1 Interface Name
/v2/profile/openid2uid
1.2 Request Parameters
Parameter | Type | Description |
---|---|---|
openid | string | [Required] openid, namely the unified unique identifier of the account (gopenid) |
token | string | [Required] token,If you use cloud game token, please add cgsource=gamematrix to the URL |
f_openid | string | [Optional] gopenid of the same channel's friend. If this field exists, 'uid' corresponding to this field is returned; otherwise, the 'uid' corresponding to the 'openid' field is returned |
1.3 Return Parameters
Parameter | Type | Description |
---|---|---|
ret | int | return code 0: correct, other: failure |
msg | string | The detailed description of the return result |
uid | string | third-party channel's account id |
1.4 Request example
- Request
curl -X POST 'https://hktest.itop.qq.com/v2/profile/openid2uid?os=2&gameid=12&source=0&channelid=1&ts=1543583577&sig=71fbf808db338a4733c194cfd0fbc0bc' -d '{"token": "16__7PhV9W6PeKtH0yW4Bs6fMwn8wYJgtwluX6_sLwxN8dfCSYajqtWUW3JPaOp170nSZNOvpr2zHHRmiERbPwmQqwrtB6nKwk0v-GhJ9JwXcg", "openid": "10259875237126117000"}'
- Response
{ "ret": 0, "msg": "success", "uid": "oHlap1Rcz0d6svU4cwah-c0L3OzQ" }
II. Query the Unified Account Id
2.1 Interface Name
/v2/profile/uid2openid
2.2 Request Parameters
Parameter | Type | Description |
---|---|---|
uid | string | [Required] third-party channel's account id |
token | string | [Required] token |
2.3 Return Parameters
Parameter | Type | Description |
---|---|---|
ret | int | return code 0: correct, other: failure |
msg | string | The detailed description of the return result |
openid | string | openid, namely the unified unique identifier of the account (gopenid) |
2.4 Request example
- Request
curl -X POST 'https://hktest.itop.qq.com/v2/profile/uid2openid?os=2&gameid=12&source=0&channelid=1&ts=1543584407&sig=6077c1a5de15a3c5e9bcdbedec2928f8' -d '{"token": "6srOlTx3YVgpNCjf5wndaT8em6PUA0QEs77OwXbIgBLoTEhbJxgoDevhrp2uxcH8", "uid": "oHlap1Rcz0d6svU4cwah-c0L3OzQ"}'
- Response
{ "ret": 0, "msg": "success", "openid": "3042973086530817307", }
III. Query the account ID of the third-party channel (without token, restricted by source)
3.1 Interface name
/v2/profile/openid2uid_notoken
3.2 Use instructtions
Without token: This interface is only used by internal components without token;
Restrict source
: Games do not need to apply for source
; source=1
when there is a request.
other components newly accessing MSDK need to apply for source
before being able to use this interface; Please contact MSDK Assistant on how to apply for source
.
3.3 Request parameters
Parameter | Type | Description |
---|---|---|
openid | string | [Required]openid, namely the unified unique identifier of the account (gopenid) |
3.4 Return parameters
Parameter | Type | Description |
---|---|---|
ret | int | Return code; 0: correct; others: failed |
msg | string | Detailed description of the return result |
uid | string | third-party channel account's ID |
3.5 Request example
Request
curl -X POST -H 'Content-Type: application/json' 'https://hktest.itop.qq.com/v2/profile/openid2uid_notoken?channelid=9&gameid=11&os=1&seq=&source=0&ts=1558666012&version=2.0&sig=5f9d773fa560bf76ca07c9fd82f76e43' -d '{"openid":"6654814801566087952"}'
Response
{
"ret":0,
"msg":"success",
"uid":"1112070588"
}
IV. Query the unified account ID (without token, restricted by source)
4.1 Interface name
/v2/profile/uid2openid_notoken
4.2 Use instructtions
Without token: This interface is only used by internal components without token;
Restricted source: Each component corresponds to a source. A new component needs to apply for a source before it can use this interface. Please contact MSDK Assistant about how to apply for a source;
4.3 Request parameters
Parameter | Type | Description |
---|---|---|
uid | string | [Required] third-party channel account's ID |
4.4 Return parameters
Parameter | Type | Description |
---|---|---|
ret | int | Return code; 0: correct; others: failed |
msg | string | Detailed description of the return result |
openid | string | openid, namely the unified unique identifier of the account (gopenid) |
4.5 Request example
Request
curl -X POST -H 'Content-Type: application/json' 'https://hktest.itop.qq.com/v2/profile/uid2openid_notoken?channelid=9&gameid=11&os=1&seq=&source=0&ts=1558666012&version=2.0&sig=06c4fd21e8f27d3da2f89ee0bcf77e49' -d '{"uid":"1112070588"}'
Response
{ "ret":0, "msg":"success", "openid":"6654814801566087952" }
V. Get the third-party channel's token
5.1 Interface name
/v2/profile/exchange_channel_token (For overseas channels only)
5.2 Request parameters
Parameter | Type | Description |
---|---|---|
openid | string | [Required] openid, namely the unified unique identifier of the account (gopenid) |
token | string | [Required] token |
5.3 Return parameters
Parameter | Type | Description |
---|---|---|
ret | int | Return code; 0: correct; others: failed |
msg | string | Detailed description of the return result |
channl_token | string | third-party channel's token |
5.4 Request example
Request
curl -X POST -H 'Content-Type: application/json' 'https://hktest.itop.qq.com/v2/profile/exchange_channel_token?channelid=9&gameid=11&os=1&seq=&source=0&ts=1558666012&version=2.0&sig=e6b72b5ad42aaed268eae5a31b950630' -d '{"openid":"6654814801566087952","token":"91c538ff9ea265af2814f35e4e72d5032178d46f"}'
Response
{ "ret":0, "msg":"success","channel_token":"1112070588-zlaMZWcXi1qClE4P0Kphux3Q90PapSy0u6PworD" }
VI. Get AppID
6.1 Interface name
/v2/comm/get_appid
6.2 Request parameter
Just fill in an empty Json object
6.3 Return parameter
parameter | type | description |
---|---|---|
ret | int | return code 0: success, other: failure |
msg | string | return result's detailed description |
appid | string | appid of third-party channel |
6.4 Request example
Request
curl -X POST -H 'Content-Type: application/json' 'https://dev.itop.qq.com/v2/comm/get_appid?channelid=2&gameid=11&os=1&seq=&source=0&ts=1559121639&version=2.0&sig=69de2d7c4225136095f5f15418d60087' -d '{}'
响应
- Response
{
"ret":0,
"msg":"success",
"appid":"1106977030"
}
All rights reserved.