Skip to main content

Query UID by OpenID (Multi-channel Package Support)

POST /v3/profile/openid2uid

This endpoint enables the game to get the third party channel ID of the user from Player Network SDK OpenID.

note

If the Player Network SDK Multi-channel Package Support for the Facebook channel is enabled, the userId of the same user under multiple Facebook AppIDs can be queried through the '/v3/profile/openid2uid' interface. Contact the Player Network representative to enable this interface.

If the Player Network SDK Multi-channel Package Support for the Facebook channel channel is not enabled, use the Query UID by OpenID interface to obtain the user's third-party channel ID.

Facebook user ID

The user identity identifiers in the Facebook channel include token_for_business and userid.

Within the Facebook channel, there are concepts of "business" and "application":

  • Business: Users who log in to different applications under the same business entity will get the same token_for_business
  • Application: Multiple applications can be used under one business entity. Users who log in to different applications under the same business will get different userId.

As shown in the figure below, a user has multiple user identity identifiers in multiple applications under the same business entity on Facebook.

Image: Facebookid_id_cn

Facebook multi-store channel packages

  • Implemented multi-store channel packages:Player Network SDK establishes a one-to-one mapping between openid and Facebook userId.
  • Not implemented multi-store channel packages:
    • Player Network SDK shields the differences of Facebook user identity across different apps, so that the same user can obtain consistent openid after logging in via the Facebook channel in different channel packages.
    • Player Network SDK selects different openid and Facebook user identity mappings for different games. For more information, reach out to the Player Network representative.

Image: openid-uid-connect-cn

Request parameters

For query parameters, see Query parameters.

FieldsTypeDescriptionRemark
openidstringPlayer Network SDK OpenIDRequired
tokenstringPlayer Network SDK TokenRequired
f_openidstringgopenid of a friend on the same channel
If gopenid exists, return the corresponding UID. Otherwise, return the corresponding UID of the specified openid.
Optional

Request sample

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

FieldsData TypeDescription
retuintResponse status, 0 stands for success, others stands for failure
msgstringResponse message
uidstringUser identifier of login channel
appid_uidobjectappid_uid obeject (additional infomation)
note

If the f_openid field is included in the request, the appid_uid section will not be included in the response. The appid_uid section uses Facebook's /me/ids_for_business API to query userids for multiple appids.

  • appid_uid object
FieldsData TypeDescription
4objectdata object, Facebook channel appid-uid info.
  • data object
FieldsData TypeDescription
dataArrayuid_data object array
retuintResponse status, 0 stands for success, others stands for failure
  • uid_data object
FieldsData TypeDescription
retuintResponse status, 0 stands for success, others stands for failure or an empty result
uidstringThe UID of the specified appid that was queried, is empty when no result is found.
app_idstringThe Facebook appid that is currently being queried.

Response sample

{
"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"
}