Skip to content

Latest commit

 

History

History
214 lines (142 loc) · 5.29 KB

webhooks.md

File metadata and controls

214 lines (142 loc) · 5.29 KB

Webhooks

6 operation(s). Part of the API index.

Call these as $client-><service>-><method>(...). <service> is the client field for this group — the README lists the field name for every service. These pages group operations the way the OpenAPI specification tags them, which is not always one field per page.


createWebhookConfiguration

POST /v2/manage/webhooks

Create webhook configuration

Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events.

Example

function callCreateWebhookConfiguration($client) {
    $webhookSubscriptionCreateModel = new \LoginRadius\Sdk\Internal\OpenApi\Model\WebhookSubscriptionCreateModel(['event' => '<event>', 'targetUrl' => '<targetUrl>']); //Optional

    try {
        $response = $client->webhooks->createWebhookConfiguration($webhookSubscriptionCreateModel);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Request body

WebhookSubscriptionCreateModel as application/json.

Returns

WebhookSubscription


deleteWebhookConfigurationById

DELETE /v2/manage/webhooks/{hookId}

Delete webhook configuration

Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications.

Example

function callDeleteWebhookConfigurationById($client) {
    $hookId = '<hookId>'; //Required

    try {
        $response = $client->webhooks->deleteWebhookConfigurationById(hookId: $hookId);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
hookId path string yes Webhook ID

Returns

DeleteResponse


getAllEvents

GET /v2/manage/webhooks/events

List webhook events

Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities.

Example

function callGetAllEvents($client) {
    try {
        $response = $client->webhooks->getAllEvents();
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Returns

WebhookEvents


getAllWebhooksConfigurations

GET /v2/manage/webhooks

List webhook configurations

Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events.

Example

function callGetAllWebhooksConfigurations($client) {
    try {
        $response = $client->webhooks->getAllWebhooksConfigurations();
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Returns

WebhookSubscriptionResponse


getWebhookConfigurationById

GET /v2/manage/webhooks/{hookId}

Retrieve webhook configuration

Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings.

Example

function callGetWebhookConfigurationById($client) {
    $hookId = '<hookId>'; //Required

    try {
        $response = $client->webhooks->getWebhookConfigurationById(hookId: $hookId);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
hookId path string yes Webhook ID

Returns

WebhookSubscription


updateWebhookConfigurationById

PUT /v2/manage/webhooks/{hookId}

Update webhook configuration

Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings.

Example

function callUpdateWebhookConfigurationById($client) {
    $hookId = '<hookId>'; //Required
    $webhookSubscriptionUpdateModel = new \LoginRadius\Sdk\Internal\OpenApi\Model\WebhookSubscriptionUpdateModel(['targetUrl' => '<targetUrl>']); //Optional

    try {
        $response = $client->webhooks->updateWebhookConfigurationById($webhookSubscriptionUpdateModel, hookId: $hookId);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
hookId path string yes Webhook ID

Request body

WebhookSubscriptionUpdateModel as application/json.

Returns

WebhookSubscription