Skip to content

Latest commit

 

History

History
196 lines (122 loc) · 7.55 KB

README.md

File metadata and controls

196 lines (122 loc) · 7.55 KB

EmailAddresses

(emailAddresses)

Overview

Available Operations

  • create - Create an email address
  • get - Retrieve an email address
  • delete - Delete an email address
  • update - Update an email address

create

Create a new email address

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\CreateEmailAddressRequestBody();

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

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

Parameters

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

Response

?Operations\CreateEmailAddressResponse

Errors

Error Type Status Code Content Type
Errors\ClerkErrors3 400, 401, 403, 404, 422 application/json
Errors\SDKException 4XX, 5XX */*

get

Returns the details of an email address.

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->emailAddresses->get(
    emailAddressId: '<id>'
);

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

Parameters

Parameter Type Required Description
emailAddressId string ✔️ The ID of the email address to retrieve

Response

?Operations\GetEmailAddressResponse

Errors

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

delete

Delete the email address with the given ID

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->emailAddresses->delete(
    emailAddressId: '<id>'
);

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

Parameters

Parameter Type Required Description
emailAddressId string ✔️ The ID of the email address to delete

Response

?Operations\DeleteEmailAddressResponse

Errors

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

update

Updates an email address.

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\UpdateEmailAddressRequestBody();

$response = $sdk->emailAddresses->update(
    emailAddressId: '<id>',
    requestBody: $requestBody

);

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

Parameters

Parameter Type Required Description
emailAddressId string ✔️ The ID of the email address to update
requestBody ?Operations\UpdateEmailAddressRequestBody N/A

Response

?Operations\UpdateEmailAddressResponse

Errors

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