ExLine.Api.Insight (ExLine v0.1.0)

Copy Markdown View Source

Aggregation-unit usage for the Messaging API.

Aggregation units group messages (via a customAggregationUnits name on a send request) so their delivery can be counted separately. The broader statistics API (message events, demographics, followers) lives in LINE's separate insight.yml spec and is not modelled here yet.

Ref: https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/

Summary

Functions

Gets the names of the aggregation units used this month.

Gets the number of aggregation units used this month.

Functions

aggregation_unit_names(client, opts \\ [])

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

Gets the names of the aggregation units used this month.

opts[:limit] caps the page size; opts[:start] is the continuation token from a previous page. Returns {:ok, %{"customAggregationUnits" => [...], "next" => ...}}.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-the-unit-names-assigned-during-this-month

aggregation_unit_usage(client)

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

Gets the number of aggregation units used this month.

Returns {:ok, %{"numOfCustomAggregationUnits" => n}}.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-the-number-of-unit-name-types-assigned-during-this-month