ExLine.Api.Webhook (ExLine v0.1.0)

Copy Markdown View Source

Manage the channel's webhook endpoint setting (get / set / test).

This is the settings API — distinct from ExLine.Webhook, which parses incoming webhook events.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information

Summary

Functions

Gets the webhook endpoint info (%{"endpoint" => url, "active" => bool}).

Sets the webhook endpoint URL.

Tests the webhook endpoint (the configured one, or opts[:endpoint] if given).

Functions

get_endpoint(client)

@spec get_endpoint(ExLine.Client.t()) :: {:ok, map()} | {:error, ExLine.Error.t()}

Gets the webhook endpoint info (%{"endpoint" => url, "active" => bool}).

set_endpoint(client, url)

@spec set_endpoint(ExLine.Client.t(), String.t()) ::
  {:ok, term()} | {:error, ExLine.Error.t()}

Sets the webhook endpoint URL.

test_endpoint(client, opts \\ [])

@spec test_endpoint(
  ExLine.Client.t(),
  keyword()
) :: {:ok, map()} | {:error, ExLine.Error.t()}

Tests the webhook endpoint (the configured one, or opts[:endpoint] if given).

Ref: https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint