Skip to content

Latest commit

 

History

History
106 lines (67 loc) · 6.05 KB

File metadata and controls

106 lines (67 loc) · 6.05 KB

CustomerPortal.CustomerSession

Overview

Available Operations

introspect

Introspect the current session and return its information.

Scopes: customer_portal:read customer_portal:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

$sdk = Polar\Polar::builder()->build();


$requestSecurity = new Operations\CustomerPortalCustomerSessionIntrospectSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->customerSession->introspect(
    security: $requestSecurity
);

if ($response->customerCustomerSession !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
security Operations\CustomerPortalCustomerSessionIntrospectSecurity ✔️ The security requirements to use for the request.

Response

?Operations\CustomerPortalCustomerSessionIntrospectResponse

Errors

Error Type Status Code Content Type
Errors\APIException 4XX, 5XX */*

getAuthenticatedUser

Get information about the currently authenticated portal user.

Scopes: customer_portal:read customer_portal:write

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Operations;

$sdk = Polar\Polar::builder()->build();


$requestSecurity = new Operations\CustomerPortalCustomerSessionGetAuthenticatedUserSecurity(
    customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);

$response = $sdk->customerPortal->customerSession->getAuthenticatedUser(
    security: $requestSecurity
);

if ($response->portalAuthenticatedUser !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
security Operations\CustomerPortalCustomerSessionGetAuthenticatedUserSecurity ✔️ The security requirements to use for the request.

Response

?Operations\CustomerPortalCustomerSessionGetAuthenticatedUserResponse

Errors

Error Type Status Code Content Type
Errors\APIException 4XX, 5XX */*