Create an OAuth2 client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Components\OAuth2ClientConfiguration(
redirectUris: [
'https://impolite-hippodrome.com/',
'https://acidic-tomography.net/',
],
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 | */* |
Get an OAuth2 client by Client ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->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;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$oAuth2ClientConfigurationUpdate = new Components\OAuth2ClientConfigurationUpdate(
redirectUris: [
'https://classic-cantaloupe.org',
'https://corrupt-status.biz/',
],
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 | */* |
Delete an OAuth2 client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->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 | */* |