Humaans.WebhookEvents (Humaans v0.6.0)

Copy Markdown View Source

This module provides functions for listing and retrieving webhook event resources in the Humaans API. Webhook events are read-only via the API.

Summary

Functions

Lists all webhook_events.

Retrieves a specific webhook_event by ID.

Types

list_response()

@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.WebhookEvent{
       created_at: term(),
       data: term(),
       event: term(),
       id: term(),
       status: term(),
       timestamp: term(),
       webhook_id: term()
     }
   ]}
  | {:error, Humaans.Error.t()}

response()

@type response() ::
  {:ok,
   %Humaans.Resources.WebhookEvent{
     created_at: term(),
     data: term(),
     event: term(),
     id: term(),
     status: term(),
     timestamp: term(),
     webhook_id: term()
   }}
  | {:error, Humaans.Error.t()}

Functions

list(client, params \\ %{})

@spec list(client :: map(), params :: map() | keyword() | [{String.t(), term()}]) ::
  {:ok, [Humaans.Resources.WebhookEvent.t()]} | {:error, Humaans.Error.t()}

Lists all webhook_events.

Returns a list of webhook_events matching the optional filter params.

Parameters

  • client - Client created with Humaans.new/1
  • params - Optional map of filter parameters (default: %{})

Examples

client = Humaans.new(access_token: "your_access_token")
{:ok, webhook_events} = Humaans.WebhookEvents.list(client)
{:ok, webhook_events} = Humaans.WebhookEvents.list(client, %{})

retrieve(client, id)

@spec retrieve(client :: map(), id :: String.t()) ::
  {:ok, Humaans.Resources.WebhookEvent.t()} | {:error, Humaans.Error.t()}

Retrieves a specific webhook_event by ID.

Parameters

  • client - Client created with Humaans.new/1
  • id - String ID of the webhook_event to retrieve

Examples

client = Humaans.new(access_token: "your_access_token")
{:ok, webhook_event} = Humaans.WebhookEvents.retrieve(client, "webhook_event_id")