declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()->build();
$request = new Components\IntrospectTokenRequest(
token: '<value>',
clientId: '<id>',
clientSecret: '<value>',
);
$response = $sdk->oauth2->introspect(
request: $request
);
if ($response->introspectTokenResponse !== null) {
// handle response
}
{
"active": true,
"client_id": "<string>",
"token_type": "access_token",
"scope": "<string>",
"sub_type": "user",
"sub": "<string>",
"aud": "<string>",
"iss": "<string>",
"exp": 123,
"iat": 123
}
Get information about an access token.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()->build();
$request = new Components\IntrospectTokenRequest(
token: '<value>',
clientId: '<id>',
clientSecret: '<value>',
);
$response = $sdk->oauth2->introspect(
request: $request
);
if ($response->introspectTokenResponse !== null) {
// handle response
}
{
"active": true,
"client_id": "<string>",
"token_type": "access_token",
"scope": "<string>",
"sub_type": "user",
"sub": "<string>",
"aud": "<string>",
"iss": "<string>",
"exp": 123,
"iat": 123
}
Successful Response
The response is of type object
.
Was this page helpful?