Constructors

Properties

enabled: boolean
messageFormat: number
name: string
optionalHeaders: object[]
url: string
webhookTriggers: string[]

Methods

  • Adds an optional header to the webhook.

    Parameters

    • name: string

      The header name.

    • value: string

      The header value.

    Returns Webhook

    The current Webhook instance for method chaining.

  • Sets whether the webhook is enabled.

    Parameters

    • enabled: boolean

      The enabled state.

    Returns Webhook

    The current Webhook instance for method chaining.

  • Sets the message format.

    Parameters

    • format: number

      The message format (0 for JSON, 1 for XML).

    Returns Webhook

    The current Webhook instance for method chaining.

  • Sets the name of the webhook.

    Parameters

    • name: string

      The new name.

    Returns Webhook

    The current Webhook instance for method chaining.

  • Sets the URL of the webhook.

    Parameters

    • url: string

      The new URL.

    Returns Webhook

    The current Webhook instance for method chaining.

  • Converts the Webhook instance to a JSON object for the API.

    Returns object

    The JSON representation of the Webhook.