LineMessaging 1.2.0

LINE Messaging API Client Library for .NET (C#)

Install-Package LineMessaging -Version 1.2.0
dotnet add package LineMessaging --version 1.2.0
<PackageReference Include="LineMessaging" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LineMessaging --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LineOAuthClient

Usage

var oAuthClient = new LineOAuthClient("Your Channel ID", "Your Channel Secret");

// get access token
var accessToken = await oAuthClient.GetAccessToken();

// revoke access token
await oAuthClient.RevokeAccessToken(accessToken);

LineWebhookRequest

Usage

var webhookRequest = new LineWebhookRequest("Your Channel Secret", HttpRequestMessage);

// verify X-Line-Signature and request body
var valid = await webhookRequest.IsValid();

// get content json
var json = await webhookRequest.GetContentJson();

// get deserialized object
var webhookContent = await webhookRequest.GetContent();

LineMessagingClient

Usage

var messagingClient = new LineMessagingClient("Access Token");

// push single message (text, image, video, audio...)
var valid = await messagingClient.PushMessage("User ID", ILineMessage);

// push multiple messages (text, image, video, audio...)
var valid = await messagingClient.PushMessage("User ID", IList<ILineMessage> messages);

// push single text message
var valid = await messagingClient.PushMessage("User ID", "text message");

// push multiple text message
var valid = await messagingClient.PushMessage("User ID", new [] { "text message 1", "text message 2" });

// multicast message
var valid = await messagingClient.MulticastMessage(LineMulticastMessage);

// multicast single text message
var valid = await messagingClient.MulticastMessage(new [] { "User ID 1", "User ID 2" }, "text message");

LineOAuthClient

Usage

var oAuthClient = new LineOAuthClient("Your Channel ID", "Your Channel Secret");

// get access token
var accessToken = await oAuthClient.GetAccessToken();

// revoke access token
await oAuthClient.RevokeAccessToken(accessToken);

LineWebhookRequest

Usage

var webhookRequest = new LineWebhookRequest("Your Channel Secret", HttpRequestMessage);

// verify X-Line-Signature and request body
var valid = await webhookRequest.IsValid();

// get content json
var json = await webhookRequest.GetContentJson();

// get deserialized object
var webhookContent = await webhookRequest.GetContent();

LineMessagingClient

Usage

var messagingClient = new LineMessagingClient("Access Token");

// push single message (text, image, video, audio...)
var valid = await messagingClient.PushMessage("User ID", ILineMessage);

// push multiple messages (text, image, video, audio...)
var valid = await messagingClient.PushMessage("User ID", IList<ILineMessage> messages);

// push single text message
var valid = await messagingClient.PushMessage("User ID", "text message");

// push multiple text message
var valid = await messagingClient.PushMessage("User ID", new [] { "text message 1", "text message 2" });

// multicast message
var valid = await messagingClient.MulticastMessage(LineMulticastMessage);

// multicast single text message
var valid = await messagingClient.MulticastMessage(new [] { "User ID 1", "User ID 2" }, "text message");

Release Notes

Add reply message methods

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.0 317 1/24/2018
1.1.2 354 1/23/2018
1.1.1 263 1/23/2018
1.1.0 261 1/23/2018
1.0.0 229 1/23/2018