Social Account

This endpoint enables registering and login with social account (e.g. Google OAuth2). The token retrieved from both the register and login endpoints can be used to authorize API requests.

Register a Social Account

You can register for a new account using the API requests as follows.

POST https://proxy.webshare.io/api/v2/register/social/
ParameterTypeDescription
providerstring

Social provider to login with. Currently only google is supported.

codestring

Then auth code received from the social provider.

redirect_uristring

Must match the authorized redirect URIs Google Credentials.

tos_acceptedboolean

Must be true to process the request.

marketing_email_acceptedboolean

Whether the service should send marketing emails to the customers.

Request & Response

register.py
import requests
 
response = requests.post(
    "https://proxy.webshare.io/api/v2/register/social/",
    json={
      "provider": "google",
      "code": "XXXX",
      "redirect_uri": "https://dashboard.webshare.io",
      "tos_accepted": True,
      "marketing_email_accepted": True,
    }
)
 
response.json()

The commands above return JSON structured like this:

response.json
{ "token": "...", "logged_in_existing_user": false }

Login with a Social Account

You can login to an existing social account using the API requests as follows.

POST https://proxy.webshare.io/api/v2/login/social/
ParameterTypeDescription
providerstring
codestring

Then auth code received from the social provider.

redirect_uristring

Request & Response

login.py
import requests
 
response = requests.post(
    "https://proxy.webshare.io/api/v2/login/social/",
    json={
      "provider": "google",
      "code": "XXXX",
      "redirect_uri": "https://dashboard.webshare.io",
    }
)
 
response.json()

The commands above return JSON structured like this:

response.json
{ "token": "..." }