Skip to content

Latest commit

 

History

History
152 lines (99 loc) · 4.59 KB

File metadata and controls

152 lines (99 loc) · 4.59 KB

ClerkBackendRedirectUrls

(redirectUrls)

Overview

Available Operations

  • create - Create a redirect URL
  • delete - Delete a redirect URL
  • get - Retrieve a redirect URL

create

Create a redirect URL

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$sdk = Backend\ClerkBackend::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$request = new Operations\CreateRedirectURLRequestBody();

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

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

Parameters

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

Response

?Operations\CreateRedirectURLResponse

Errors

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

delete

Remove the selected redirect URL from the whitelist of the instance

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;

$sdk = Backend\ClerkBackend::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



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

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

Parameters

Parameter Type Required Description
id string ✔️ The ID of the redirect URL

Response

?Operations\DeleteRedirectURLResponse

Errors

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

get

Retrieve the details of the redirect URL with the given ID

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Clerk\Backend;

$sdk = Backend\ClerkBackend::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



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

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

Parameters

Parameter Type Required Description
id string ✔️ The ID of the redirect URL

Response

?Operations\GetRedirectURLResponse

Errors

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