(auth)
REST APIs for managing Authentication
- getAccessToken - Get or refresh an access token for the current workspace.
- getUser - Get information about the current user.
- getAccess - Get access allowances for a particular workspace
- validateApiKey - Validate the current api key.
Get or refresh an access token for the current workspace.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
$sdk = SpeakeasyClientSDK\SDK::builder()->build();
$request = new Operations\GetAccessTokenRequest(
workspaceId: '<id>',
);
$response = $sdk->auth->getAccessToken(
request: $request
);
if ($response->accessToken !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetAccessTokenRequest | ✔️ | The request object to use for the request. |
?Operations\GetAccessTokenResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Get information about the current user.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$response = $sdk->auth->getUser(
);
if ($response->user !== null) {
// handle response
}
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |
Checks if generation is permitted for a particular run of the CLI
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$request = new Operations\GetWorkspaceAccessRequest();
$response = $sdk->auth->getAccess(
request: $request
);
if ($response->accessDetails !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetWorkspaceAccessRequest | ✔️ | The request object to use for the request. |
?Operations\GetWorkspaceAccessResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\SDKException | 4XX, 5XX | */* |
Validate the current api key.
declare(strict_types=1);
require 'vendor/autoload.php';
use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;
$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();
$response = $sdk->auth->validateApiKey(
);
if ($response->apiKeyDetails !== null) {
// handle response
}
?Operations\ValidateApiKeyResponse
Error Type | Status Code | Content Type |
---|---|---|
Errorors\Error | 4XX | application/json |
Errorors\SDKException | 5XX | */* |