Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 4.15 KB

README.md

File metadata and controls

56 lines (35 loc) · 4.15 KB

WebhookSecret

Overview

Available Operations

  • retrieve - Get the webhook signing secret

retrieve

Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the modapi-signature header to HMAC-SHA256(raw request body, secret) hex-encoded.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use ModerationApi;

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



$response = $sdk->webhookSecret->retrieve(

);

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

Parameters

Parameter Type Required Description
projectId ?string ➖ The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.

Response

?Operations\GetWebhookSecretResponse

Errors

Error Type Status Code Content Type
Errors\AuthenticationError 401 application/json
Errors\RateLimitError 429 application/json
Errors\APIException 4XX, 5XX */*