OAuth API

get
Render OAuth Login Page

https://api.playportal.io/oauth/signin
This endpoint renders the OAuth login and onboarding page. This page can be displayed in a browser or an app's webview. Your app should be configured to accept a redirect from the OAuth screen and should capture the resulting tokens to maintain the logged in user's session.
Request
Response
Request
Query Parameters
app_login
optional
boolean
Determines whether or not the OAuth screen should include the "Login via playPORTAL App" button. Set to "true" if your client is an app to allow users to login if they have the playPORTAL app.
state
required
string
This will be passed through the auth flow and to the redirect URI. Can be any arbitrary string.
redirect_uri
required
string
After logging in, the user will be redirected to this URI. Must be registered for your app in playPORTAL Studio beforehand.
response_type
required
string
Determines what auth flow to use. Can be "code" or "implicit". "Code" auth flow will generate an auth code which can be used to retrieve an auth token, while "implicit" will generate an auth and refresh token directly.
client_id
required
string
Your app's client ID, generated in playPORTAL Studio.
Response
200: OK
Cake successfully retrieved.
OAuth login page.
400: Bad Request
Invalid response_type parameter.
{
"message": "Response type not supported",
"number": 4002
}
401: Unauthorized
App has not been approved.
{
"message": "App has not been approved by playPORTAL staff yet.",
"number": 4013
}
404: Not Found
No app found with supplied client ID.
{
"message": "No app found with specified client ID.",
"number": 4041
}

post
Refresh or Generate Auth Token

https://api.playportal.io/oauth/token
Generates an auth token with a code or refreshes a session using a refresh token.
Request
Response
Request
Body Parameters
grant_type
required
string
Can be "refresh_token" if refreshing an existing session or "authorization_code" if generating an auth token with a code.
client_id
required
string
Your app's client ID from playPORTAL Studio.
client_secret
optional
string
Your app's client secret from playPORTAL Studio. Required for grant_type "refresh_token".
code
optional
string
An authorization code generated from the OAuth flow. Required if using grant_type "authorization_code".
redirect_uri
optional
string
A URI to redirect to once the auth token generation is complete. Must be registered in playPORTAL Studio. Required if using grant_type "authorization_code".
refresh_token
optional
string
Refresh token generated by the OAuth flow. Required if using grant_type "refresh_token".
Response
200: OK
If using grant_type "refresh_token" a JSON structure is returned.
{ access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6Ijg5MTNhNjNmNGEzNGU4ZTZmOGI0Zjg4MjY4ZWM1OGM3NWQwOThiNTYyYWFlNmJjMWZhM2ZhNjBkN2M4YWY5MTIxMThiZWNjNDdhY2I0NzNmNmFhYWNhNjBmMjdjNGY0OGJjNWVlYjE5NGNkMGI2MmI2YTU4MTRhNjRmMjg1OTRkNTVmNjQ0NmE0ZGFhODUxY2RlODFjMWVmMzhiZTBlOTYyMyQxMDI4YTQ4MzVmMjlmZTM4M2E1YzhlZjM0M2E3ZGNhMSIsImlhdCI6MTU0ODk2MTM3NywiZXhwIjoxNTQ4OTYxNDA3LCJhdWQiOiJpb2stY2lkLTYzYTM1ZTZkNjI5NTUyMDFlNjIxMWE4MzU3YTFlMWVhOTNmZmU1ZDRmOTA0MzBkOSIsImlzcyI6InNzby5pb2tpZHMubmV0Iiwic3ViIjoiODkxM2E2M2Y0YTM0ZThlNmY4YjRmODgyNjhlYzU4Yzc1ZDA5OGI1NjJhYWU2YmMxZmEzZmE2MGQ3YzhhZjkxMjExOGJlY2M0N2FjYjQ3M2Y2YWFhY2E2MGYyN2M0ZjQ4YmM1ZWViMTk0Y2QwYjYyYjZhNTgxNGE2NGYyODU5NGQ1NWY2NDQ2YTRkYWE4NTFjZGU4MWMxZWYzOGJlMGU5NjIzJDEwMjhhNDgzNWYyOWZlMzgzYTVjOGVmMzQzYTdkY2ExIiwianRpIjoiZTcxZDFiZmY1Mzc0MjE3YWMxMDUxMWExZmZkN2Q0NDk0NTMyMmRjMDY5MGYxODNmMDMxZjE3MDRmZDJmYzc2YiJ9.kdVJzH0Tlg12MWq5EB9Hb9M0zGv8JnzJYLAGoDnJsBg',
refresh_token: '99d26e731f5a651b19c2134f6d09bd4c45da73600c161877d3bc045265e8951a',
expires_in: '1d',
token_type: 'Bearer' }
302: Found
If using grant_type "authorization_code" there will be a redirect.
Redirect to specified URL.

post
Logout

https://api.playportal.io/oauth/logout
Logs out a user that has been logged in via the OAuth screen.
Request
Response
Request
Body Parameters
refresh_token
required
string
Refresh token generated by the OAuth flow.
Response
200: OK