LINE.Bot.Insight (line_bot_sdk v0.1.0)

Copy Markdown

API calls for all endpoints tagged Insight.

Summary

Functions

Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).

Get user interaction statistics Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.

Get number of followers Returns the number of users who have added the LINE Official Account on or before a specified date.

Get number of message deliveries Returns the number of messages sent from LINE Official Account on a specified day.

Get rich menu insight daily Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only richMenuId is returned and the other fields are omitted.

Get rich menu insight summary Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only richMenuId is returned and the other fields are omitted.

You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.

Create a new Insight client.

Functions

get_friends_demographics(client, client_opts \\ [])

Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).

Parameters

Returns

  • {:ok, LINE.Bot.Model.GetFriendsDemographicsResponse.t} on success
  • {:error, Req.Response.t} on failure

get_message_event(client, request_id, client_opts \\ [])

Get user interaction statistics Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • request_id (String.t/0): Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID.
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetMessageEventResponse.t} on success
  • {:error, Req.Response.t} on failure

get_number_of_followers(client, optional_args \\ [], client_opts \\ [])

Get number of followers Returns the number of users who have added the LINE Official Account on or before a specified date.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • optional_args (keyword): Optional parameters
    • :date (String.t/0): Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetNumberOfFollowersResponse.t} on success
  • {:error, Req.Response.t} on failure

get_number_of_message_deliveries(client, date, client_opts \\ [])

Get number of message deliveries Returns the number of messages sent from LINE Official Account on a specified day.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • date (String.t/0): Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetNumberOfMessageDeliveriesResponse.t} on success
  • {:error, Req.Response.t} on failure

get_rich_menu_insight_daily(client, rich_menu_id, from, to, client_opts \\ [])

Get rich menu insight daily Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only richMenuId is returned and the other fields are omitted.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • rich_menu_id (String.t/0): ID of the rich menu created via the Messaging API.
  • from (String.t/0): Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
  • to (String.t/0): End date of the aggregation period (inclusive). The end date can be specified for up to 99 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetRichMenuInsightDailyResponse.t} on success
  • {:error, Req.Response.t} on failure

get_rich_menu_insight_summary(client, rich_menu_id, from, to, client_opts \\ [])

Get rich menu insight summary Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only richMenuId is returned and the other fields are omitted.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • rich_menu_id (String.t/0): ID of the rich menu created via the Messaging API.
  • from (String.t/0): Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9
  • to (String.t/0): End date of the aggregation period (inclusive). The end date can be specified for up to 396 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetRichMenuInsightSummaryResponse.t} on success
  • {:error, Req.Response.t} on failure

get_statistics_per_unit(client, custom_aggregation_unit, from, to, client_opts \\ [])

You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • custom_aggregation_unit (String.t/0): Name of aggregation unit specified when sending the message. Case-sensitive. For example, Promotion_a and Promotion_A are regarded as different unit names.
  • from (String.t/0): Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9
  • to (String.t/0): End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetStatisticsPerUnitResponse.t} on success
  • {:error, Req.Response.t} on failure

new(options \\ [])

Create a new Insight client.

Options

  • :base_url - base URL for requests (default: "https://api.line.me")
  • :channel_token (required) - channel access token for Bearer authorization
  • :plug - plug to use for testing (see Req.new/1)