Skip to content

Latest commit

 

History

History
235 lines (144 loc) · 7.67 KB

README.md

File metadata and controls

235 lines (144 loc) · 7.67 KB

JwtTemplates

(jwtTemplates)

Overview

Available Operations

  • list - List all templates
  • create - Create a JWT template
  • get - Retrieve a template
  • update - Update a JWT template
  • delete - Delete a Template

list

List all templates

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();



$response = $sdk->jwtTemplates->list(

);

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

Response

?Operations\ListJWTTemplatesResponse

Errors

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

create

Create a new JWT template

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;
use Clerk\Backend\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();

$request = new Operations\CreateJWTTemplateRequestBody();

$response = $sdk->jwtTemplates->create(
    request: $request
);

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

Parameters

Parameter Type Required Description
$request Operations\CreateJWTTemplateRequestBody ✔️ The request object to use for the request.

Response

?Operations\CreateJWTTemplateResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors63 400, 402, 422 application/json
Errors\SDKException 4XX, 5XX */*

get

Retrieve the details of a given JWT template

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();



$response = $sdk->jwtTemplates->get(
    templateId: '<id>'
);

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

Parameters

Parameter Type Required Description
templateId string ✔️ JWT Template ID

Response

?Operations\GetJWTTemplateResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors64 404 application/json
Errors\SDKException 4XX, 5XX */*

update

Updates an existing JWT template

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;
use Clerk\Backend\Models\Operations;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();

$requestBody = new Operations\UpdateJWTTemplateRequestBody();

$response = $sdk->jwtTemplates->update(
    templateId: '<id>',
    requestBody: $requestBody

);

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

Parameters

Parameter Type Required Description
templateId string ✔️ The ID of the JWT template to update
requestBody ?Operations\UpdateJWTTemplateRequestBody N/A

Response

?Operations\UpdateJWTTemplateResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors65 400, 402, 422 application/json
Errors\SDKException 4XX, 5XX */*

delete

Delete a Template

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();



$response = $sdk->jwtTemplates->delete(
    templateId: '<id>'
);

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

Parameters

Parameter Type Required Description
templateId string ✔️ JWT Template ID

Response

?Operations\DeleteJWTTemplateResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors66 403, 404 application/json
Errors\SDKException 4XX, 5XX */*