Exchange tokens
Exchange authorization code or refresh token for access tokens
Responses
Successful token response application/json
access_tokenstringrequired
token_typestringrequired
― Bearer
expires_inintegerrequired
Expiration time in seconds
refresh_tokenstring
scopestring
Space-separated list of granted scopes
id_tokenstring
JWT containing user claims
expires_atinteger
Timestamp when the token expires
{ "access_token": "string", "token_type": "Bearer", "expires_in": 0, "refresh_token": "string", "scope": "string", "id_token": "string", "expires_at": 0}
Error response application/json
errorstringrequired
― invalid_request
― invalid_client
― invalid_grant
― unauthorized_client
― unsupported_grant_type
― invalid_scope
― authorization_pending
― slow_down
― expired_token
error_descriptionstring
error_uristring · uri
{ "error": "invalid_request", "error_description": "string", "error_uri": "https://example.com"}
Invalid client credentials application/json
errorstring
― invalid_client
error_descriptionstring
{ "error": "invalid_client", "error_description": "string"}
POST
/oauth/token
Server URL: https://api.yotoplay.com
Authorization (bearerAuth)
Request Body
curl "https://api.yotoplay.com/oauth/token"--header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'POST', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' }};
fetch('https://api.yotoplay.com/oauth/token', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.yotoplay.com/oauth/token", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => [ "Authorization: Bearer [YOUR_TOKEN]" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
import requests
url = "https://api.yotoplay.com/oauth/token"
headers = { "Authorization": "Bearer [YOUR_TOKEN]"}
response = requests.request("POST", url, headers=headers)
print(response.text)