Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 5.08 KB

README.md

File metadata and controls

49 lines (31 loc) · 5.08 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

from moderation_api import ModerationAPI
import os


with ModerationAPI(
    secret_key=os.getenv("MODAPI_SECRET_KEY", ""),
) as ma_client:

    res = ma_client.webhook_secret.retrieve()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
project_id Optional[str] ➖ 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.
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.GetWebhookSecretResponse

Errors

Error Type Status Code Content Type
errors.AuthenticationError 401 application/json
errors.RateLimitError 429 application/json
errors.ModerationAPIDefaultError 4XX, 5XX */*