Class MessagingClient
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
authProviderIAuthenticationProviderAuthentication provider (static or refreshing, either works).
httpClientHttpClientThe HttpClient shared by the two adapters (control plane and data plane). Supplied by
IHttpClientFactoryvia 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
channelAccessTokenstring