GitHunt

Line Bot Message API

Set Up Line Bot configuration

export LINE_BOT_CHANNEL_TOKEN=YOUR_LINE_BOT_CHANNEL_TOKEN
export LINE_BOT_CHANNEL_SECRET=YOUR_LINE_BOT_CHANNEL_SECRET
  • Generate a https endpoint with ngrok
ngrok http 8081

  • Replace webhook settings with the above result

  • Run MongoDB with Docker

docker run --name mongo -d -p 27017:27017 --rm mongo
  • NOW, You can start Spring Boot project

LINE Bot Account(Scan following QR Code)



Chat with LINE BOT[If you want to reply yourself, you can use the following response API]


  • LINE Bot Reply API:
curl -X POST http://localhot:8080/message  \
     -H "Content-Type: application/json" \
     -d '{"userId":"userId", "text":"Hello"}'
  • Response
{"statusCode":200,"data":null}
  • User Query API:
curl -X POST http://localhot:8080/message/U782sdsdsdea59f9f9f7ecde11cb1a010e
  • Response
{"statusCode":200,"data":["Amy","Eric","Andy","Jolin"]}

TODO

  • Get reply token from API due to expiration policy
  • Support message response with multi-line

Languages

Java100.0%

Contributors

Created December 8, 2023
Updated December 13, 2023