Table of Contents

Class MessagingClient

Namespace
Line.OpenApi.Messaging
Assembly
Line.OpenApi.Messaging.dll

Facade for the Messaging API. It unifies the two Kiota clients for the control plane (api.line.me) and the data plane (api-data.line.me) so callers do not have to think about the host difference.

Usage: var line = MessagingClient.CreateWithStaticToken("CHANNEL_ACCESS_TOKEN"); await line.Api.V2.Bot.Message.Push.PostAsync(pushRequest); // send (control plane) var stream = await line.Blob.V2.Bot.Message[messageId].Content.GetAsync(); // fetch (data plane)

public sealed class MessagingClient
Inheritance
MessagingClient
Inherited Members

Constructors

MessagingClient(IAuthenticationProvider, HttpClient?)

public MessagingClient(IAuthenticationProvider authProvider, HttpClient? httpClient = null)

Parameters

authProvider IAuthenticationProvider

Authentication provider (static or refreshing, either works).

httpClient HttpClient

The HttpClient shared by the two adapters (control plane and data plane). Supplied by IHttpClientFactory via DI (shared handler pool, Kiota default middleware applied). When null, each adapter creates its own default HttpClient (for PoC/quick use). Since the adapters build the URLs themselves, BaseAddress is not used, so sharing one is fine.

Properties

Api

Control-plane client (send, reply, rich-menu operations, etc.; api.line.me).

public MessagingApiClient Api { get; }

Property Value

MessagingApiClient

Blob

Data-plane client (content download, image upload, etc.; api-data.line.me).

public MessagingBlobApiClient Blob { get; }

Property Value

MessagingBlobApiClient

Methods

CreateWithStaticToken(string)

Helper to quickly construct from a long-lived channel access token.

public static MessagingClient CreateWithStaticToken(string channelAccessToken)

Parameters

channelAccessToken string

Returns

MessagingClient