Skip to main content

Query Third-Party Channel Account ID (Multi-Merchant Channel Package)

POST /v3/profile/openid2uid

This interface allows the game to acquire the user's third-party channel ID from Player Network SDK OpenID.

note

By enabling the Facebook channel multi-channel package support solution, you can query the same user’s userId under multiple Facebook AppIDs via the '/v3/profile/openid2uid' interface. Please contact the Player Network Assistant to enable this interface.

If you have not enabled the Facebook channel multi-channel package support solution, you can use the Query Third-Party Channel Account ID interface to obtain the user’s third-party channel ID.

Facebook User ID

The user's identity on Facebook Channel includes token_for_business and userid.

In the Facebook Channel, concepts of merchant and application exist:

  • Merchant: The token_for_business acquired is the same when a user logs in to different applications under the same merchant.
  • Application: Multiple applications can be used under a single merchant.The userId acquired is different when a user logs in to different applications under the same merchant.

As shown in the image, a user has multiple user identity identifiers in various applications under the same merchant on Facebook.

Image: iOS Facebookid_id_cn

Facebook Multi-Channel Package Scenario

  • Without using Multi-Store Channel Package: Player Network SDK's openid establishes a one-to-one relationship with Facebook's userId.
  • Using Multi-Store Channel Package:
    • Player Network SDK masks the differences in Facebook user identity identifiers across different applications, ensuring the openid remains consistent when the same user logs into different channel packages through the Facebook channel.
    • Player Network SDK selects different openid and Facebook user identity identifier correspondences for different games.If you wish to know more details, you can contact Player Network Assistant.

Image: iOS openid-uid-connect-cn

Request Parameters

ParametersTypeDescriptionNotes
openidstringPlayer Network SDK OpenIDRequired
tokenstringPlayer Network SDK TokenRequired
f_openidstringPlayer Network SDK OpenID of a friend from the same channel; if this field exists, the corresponding uid is returned, otherwise the uid corresponding to the openid field is returned.
Note: If you provide this field, the response will not include the appid_uid section.
Optional

Request Example

curl -sS -X POST 'https://test.intlgame.com/v3/profile/openid2uid?channelid=4&gameid=11&os=3&sdk_version=2.0&source=0&ts=1682336757&sig=7ff4a738a2eb7a7ced667df0262e726f' -d '{"openid":"221323526123","token":"3d232b3138dab682469b6f5e4ed839f964da0993"}'

Response Parameters

ParametersTypeDescription
retuintResponse status, 0 stands for success, others stand for failure
msgstringResponse message
uidstringUser identifier of login channel
appid_uidobjectappid_uid object -- Additional information
note

If the f_openid field is provided in the request, the response will not include the appid_uid section.appid_uid uses the /me/ids_for_business API capability provided by Facebook to query userIds under multiple appids.

  • appid_uid
ParametersTypeDescription
4objectdata object, appid-uid information for Facebook channel
  • data
ParametersTypeDescription
dataArrayuid_data object array
retuintReturn code
0: Success
Other: Failure
  • uid_data
ParametersTypeDescription
retuintQuery status, non-zero indicates query failure/query is empty
uidstringQueried uid of the specified appid; empty indicates not queried
app_idstringCurrently queried Facebook appid

Return Example

{
"appid_uid": {
"4": {
"data": [
{
"app_id": "5362764250xxxxx",
"ret": 0,
"uid": "1736156650xxxx"
},
{
"app_id": "12388499200xxxx",
"ret": 0,
"uid": "3342513200xxxx"
}
],
"ret": 0
}
},
"msg": "success",
"openid": "xxxxxxxxxxxxxxxx",
"ret": 0,
"seq": "xxxxxxxxxx-xxxxxxxxxx-xxxxx-xxxxxxxxxx",
"uid": "xxxxxxxxxxxxxxxx"
}