LINE Messaging API SDK for Rust
Introduction
This is a library originating from nanato12/line-bot-sdk-rust, but with more complete api, newer versions of dependencies and more additional features.
The LINE Messaging API SDK for Rust makes it easy to develop bots using LINE Messaging API, and you can create a sample bot within minutes.
Documentation
See the official API documentation for more information.
- English: https://developers.line.biz/en/docs/messaging-api/overview/
- Japanese: https://developers.line.biz/ja/docs/messaging-api/overview/
Requirements
This library requires stable/beta Rust.
Installation
Cargo
You can install with command below
Or add this line to Cargo.toml
= "<version>"
Git
Add content below to your Cargo.toml
[]
= "https://github.com/Kayxue/LineBotSdkRust.git"
= "master"
Web framework support
Extract x-line-signature from the request header.
Use rocket framework
[]
...
= ["rocket_support"]
use Signature;
use ;
async
Use actix_web framework
[]
...
= ["actix_support"]
use ;
use Signature;
async
Use axum framework (Additional Support)
[]
...
= ["axum_support"]
use ;
use Signature;
async
Use ntex framework (Additional Support)
[]
...
= ["ntex_support"]
use ;
use Signature;
async
Use xitca-web framework (Additional Support)
[]
...
= ["xitca_support"]
use ;
use Signature;
async
Configuration
use LINE;
use env;
How to use
The LINE Messaging API uses the JSON data format.
For example, parse body (&str) into Result<CallbackRequest, serde_json::Error>.
let request: = from_str;
Or directly parse body from bytes body.
let request: = from_slice;
Then:
match request
Bot Examples
- LineBotSdkExample: Some examples of using this Rust library.
- GitHubPushWebhookLineBotRust: Line bot for sending GitHub push webhook to Line, but in Rust
Contributing
Contributions are welcome! And please follow Code of Conduct.
License
Copyright 2025 KayXue
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---
This project contains code under the Apache License 2.0:
lib/src/client/mod.rs
lib/src/parser/mod.rs
lib/src/parser/signature.rs
lib/src/support/actix.rs
lib/src/support/mod.rs
lib/src/support/rocket.rs
The following license applies to these files:
Apache License 2.0
Copyright (c) 2023 nanato12
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.