lineapi-rs
LINE API library supporting both LINE Messaging API and LINE Login API.
Changes
Supported APIs
LINE Messaging API
- get_v2_bot_info
- get_v2_bot_insight_message_event_aggregation
- get_v2_bot_message_aggregation_info
- get_v2_bot_message_aggregation_list
- get_v2_bot_message_quote
- get_v2_bot_message_quote_consumption
- get_v2_bot_profile
- post_v2_bot_message_push
- post_v2_bot_message_validate_push
LINE Login API (v0.6.0+)
- get_friendship_v1_status
- get_oauth2_v2_1_userinfo
- get_oauth2_v2_1_verify
- get_v2_profile
- post_oauth2_v2_1_revoke
- post_oauth2_v2_1_token
- post_oauth2_v2_1_verify
- post_user_v1_deauthorize
- oauth_url helper function (v0.6.1) - Generate OAuth authorization URL with PKCE support
Features
- Retry mechanism with exponential backoff
- Configurable timeout duration
- Configurable retry duration
- Mock support for testing
- Stream support for large data
- PKCE (Proof Key for Code Exchange) support for OAuth
Examples
OAuth Web Application (examples/oauth/)
A complete web application demonstrating LINE Login integration with PKCE (Proof Key for Code Exchange).
Features:
- OAuth authorization URL generation with PKCE
- State parameter validation for security
- Authorization code exchange for access token
- User profile retrieval using access token
- Secure cookie-based session management
Usage:
LINE_CLIENT_ID=your_client_id \
LINE_CLIENT_SECRET=your_client_secret \
LINE_REDIRECT_URI=http://localhost:5173/oauth-line \
Flow:
- Visit
http://localhost:5173/to start OAuth flow - Click the OAuth link to authorize with LINE
- Get redirected back with user profile information
Dependencies:
axum- Web frameworktower-cookies- Cookie managementuuid- Generate secure PKCE verifier and state