A lightweight, local emulator for the LINE Messaging API that allows developers to test their LINE bot applications without connecting to the actual LINE servers. This emulator implements the endpoints defined in the official LINE OpenAPI specifications, including messaging endpoints and webhook handling.
- Local Testing Environment: Test your LINE bot locally without requiring internet access or LINE accounts
- Messaging API Coverage: Implements endpoints from the official LINE Messaging API specification
- Webhook Support: Simulates webhook events for testing bot responses
- No Authentication Required: Skip the complexity of managing channel access tokens during development
- OpenAPI Compliant: Based on the official LINE OpenAPI specifications for accuracy
- Go 1.24.4 or higher
- Make (optional, for using Makefile commands)
- Atlas CLI (
curl -sSf https://atlasgo.sh | sh -s --)
Clone the repository:
git clone https://github.com/zero-color/line-messaging-api-emulator.git
cd line-messaging-api-emulatorInstall dependencies:
go mod downloadStart the emulator server using one of the following methods:
Using Make:
make runUsing Go directly:
go run ./cmd/serverWith custom port:
go run ./cmd/server --port 8080By default, the server runs on port 9090.
The project includes a Makefile with helpful commands:
make run- Start the emulator servermake test- Run all testsmake lint- Run code lintersmake help- Display all available commands
The emulator implements the following LINE Messaging API endpoints:
GET /v2/bot/channel/webhook/endpoint- Get webhook endpoint informationPUT /v2/bot/channel/webhook/endpoint- Set webhook endpoint URLPOST /v2/bot/channel/webhook/test- Test webhook endpoint
POST /v2/bot/message/reply- Send reply messagePOST /v2/bot/message/push- Send push messagePOST /v2/bot/message/multicast- Send multicast messagePOST /v2/bot/message/narrowcast- Send narrowcast messagePOST /v2/bot/message/broadcast- Send broadcast message
GET /v2/bot/message/{messageId}/content- Download image, video, and audio dataGET /v2/bot/message/{messageId}/content/preview- Get preview imageGET /v2/bot/message/{messageId}/content/transcoding- Check transcoding status
GET /v2/bot/profile/{userId}- Get user profileGET /v2/bot/followers/ids- Get follower IDs
GET /v2/bot/group/{groupId}/member/{userId}- Get group member profileGET /v2/bot/room/{roomId}/member/{userId}- Get room member profilePOST /v2/bot/group/{groupId}/leave- Leave groupPOST /v2/bot/room/{roomId}/leave- Leave room
POST /v2/bot/richmenu- Create rich menuGET /v2/bot/richmenu/{richMenuId}- Get rich menuDELETE /v2/bot/richmenu/{richMenuId}- Delete rich menuGET /v2/bot/richmenu/list- Get rich menu list
For a complete list of endpoints, refer to the OpenAPI specification.
.
├── cmd/
│ └── server/ # Server entrypoint
│ └── main.go
├── line-openapi/ # LINE OpenAPI specifications
│ ├── messaging-api.yml
│ ├── webhook.yml
│ └── ...
├── go.mod # Go module dependencies
├── go.sum # Go module checksums
├── Makefile # Build and development commands
└── README.md # This file
Run the test suite:
make testThe tests use gotestsum for better output formatting and include race condition detection.
Run linters to ensure code quality:
make lintThe project uses golangci-lint for comprehensive code analysis.
The server accepts the following command-line options:
--port- HTTP port number (default: 9090)--help- Display help information
Example:
go run ./cmd/server --port 8080To use this emulator with your LINE bot application:
- Start the emulator server
- Configure your bot application to use
http://localhost:9090as the LINE API base URL - Point webhook URLs to your bot application
- Send test messages through the emulator's API endpoints
Example webhook test:
curl -X POST http://localhost:9090/v2/bot/channel/webhook/test \
-H "Content-Type: application/json" \
-d '{
"endpoint": "http://localhost:3000/webhook"
}'Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the terms specified in the LICENSE file.
- Based on the official LINE OpenAPI specifications
- Built with chi router for HTTP routing
This is an unofficial emulator for development and testing purposes only. It is not affiliated with or endorsed by LINE Corporation. For production use, always use the official LINE Messaging API.
For issues, questions, or suggestions, please open an issue on the GitHub repository.