/
v3.0.11Get access

socialNetworkLogin

This API endpoint represents Step 2 of the OAuth2 authentication flow. Once the user successfully authenticates on the social platform (like Google), the platform redirects them back to your application with a temporary authorization code. Your frontend captures that code and sends this request to your backend to finalize the login and establish a user session.

Request parameters:

Name
DescriptionTypeValuesDefault
code
The temporary, single-use Authorization Code granted by the social network after the user logged in.string--
redirectUrl
The exact same callback URL that was sent in the initial request. OAuth 2.0 security standards require this to match exactly, or the social provider will reject the exchange.string--
socialNetworkTypeId
Identifies which social network issued the code.stringSocial Types-
socialNetworkType
Identifies which social network issued the code.Old versionstring--
state
Extracted state receive from social platformstring--
This method is usually used with these methods:

Call example:

socialNetworkLogin({
  code: 'bTNWWkpnTE5uV2FBX2kxcDlob1FDTWFmb0hlQlZFZ3VUaVFlS2phTmZaLUh5OjE3OTMyODA3Mzk0MTQ6MToxOmFjOjE',
  redirect_url: 'https://sso-twitter.betchain-stage.betcoapps.com/',
  social_network_type: '',
  social_network_type_id: 3,
  state: '8dfbd5b6051046dfa620c1c7d7df8655'
})

Response examples:

{
  code: 0,
  rid: 1753217755,
  data: {
    result: 0,
    result_text: null,
    details: {
      user_id: 344454,
      auth_token: 'as245421ve2456',
      jwe_token: 'as2454343421ve2456',
      deposit_count: 0,
      deposit_amount: 0,
      withdrawal_amount: 0,
      authentication_status: 0,
      is_new_client: false,
      qr_code_origin: null,
      needs_subscriptions_update: false
    }
  }
}

Response parameters:

NameDescriptionTypeValues
user_id
The unique internal database identifier for the playernumber-
auth_token
This is the bearer token (JWT or similar)string-
authentication_status
Indicates the current security state of the accountnumber0, 4, etc.
deposit_count
The total number of deposits made by the usernumber-
qr_code_origin
Likely used for tracking marketing attribution (e.g., if the user registered by scanning a physical QR code) or for generating a specific Two-Factor Authentication (2FA) or payment gateway origin.string-
is_new_client
A flag indicating if this is the user's first time logging into the platform.booleantrue / false