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/
Parameter | Type | Description |
---|---|---|
provider | string | Social provider to login with. Currently only |
code | string | Then auth code received from the social provider. |
redirect_uri | string | Must match the authorized redirect URIs Google Credentials. |
tos_accepted | boolean | Must be |
marketing_email_accepted | boolean | Whether the service should send marketing emails to the customers. |
Request & Response
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:
{ "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/
Parameter | Type | Description |
---|---|---|
provider | string | |
code | string | Then auth code received from the social provider. |
redirect_uri | string |
Request & Response
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:
{ "token": "..." }