(oauth2->clients)
- list - List Clients
- create - Create Client
- delete - Delete Client
- get - Get Client
- update - Update Client
List OAuth2 clients.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$responses = $sdk->oauth2->clients->list(
page: 1,
limit: 10
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
page |
?int | ➖ | Page number, defaults to 1. |
limit |
?int | ➖ | Size of a page, defaults to 10. Maximum is 100. |
?Operations\Oauth2ClientsListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Create an OAuth2 client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$request = new Components\OAuth2ClientConfiguration(
redirectUris: [
'https://probable-heating.com/',
],
clientName: '<value>',
);
$response = $sdk->oauth2->clients->create(
request: $request
);
if ($response->any !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Components\OAuth2ClientConfiguration | ✔️ | The request object to use for the request. |
?Operations\Oauth2ClientsOauth2CreateClientResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete an OAuth2 client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->oauth2->clients->delete(
clientId: '<id>'
);
if ($response->any !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
clientId |
string | ✔️ | N/A |
?Operations\Oauth2ClientsOauth2DeleteClientResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get an OAuth2 client by Client ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->oauth2->clients->get(
clientId: '<id>'
);
if ($response->any !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
clientId |
string | ✔️ | N/A |
?Operations\Oauth2ClientsOauth2GetClientResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update an OAuth2 client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$oAuth2ClientConfigurationUpdate = new Components\OAuth2ClientConfigurationUpdate(
redirectUris: [
'https://passionate-flu.org',
],
clientName: '<value>',
clientId: '<id>',
);
$response = $sdk->oauth2->clients->update(
clientId: '<id>',
oAuth2ClientConfigurationUpdate: $oAuth2ClientConfigurationUpdate
);
if ($response->any !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
clientId |
string | ✔️ | N/A |
oAuth2ClientConfigurationUpdate |
Components\OAuth2ClientConfigurationUpdate | ✔️ | N/A |
?Operations\Oauth2ClientsOauth2UpdateClientResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |