ExLine.Api.Membership (ExLine v0.1.0)

Copy Markdown View Source

LINE Official Account membership (paid subscription) information.

Ref: https://developers.line.biz/en/docs/messaging-api/membership/

Summary

Functions

Gets the user IDs who joined the given membership_id.

Gets the list of membership plans on the account.

Gets a user's membership subscription status.

Functions

joined_users(client, membership_id, opts \\ [])

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

Gets the user IDs who joined the given membership_id.

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

Ref: https://developers.line.biz/en/reference/messaging-api/#get-a-list-of-users-who-joined-the-membership

list(client)

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

Gets the list of membership plans on the account.

Returns {:ok, %{"memberships" => [...]}}.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-membership-plans

subscription(client, user_id)

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

Gets a user's membership subscription status.

Ref: https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status