Skip to content

divazone/fastapi-line-notify

Repository files navigation

FastAPI-LINE-notify

It's sample code of Lotify by FastAPI.

LINE Notify singup

Set the Callback URL to http://YOUR_DOMAIN/callback, and for local testing, use http://localhost:8000/callback

Local testing

cp .env.sample .env
uvicorn main:app --host=0.0.0.0 --port=8000

or

cp .env.sample .env
docker-compose up

Choose one of the two methods.

Step

LINE Notify Basic settings


Initial page

After opening the browser and entering http://localhost:8000 , you will see an input button.


Bind notifications - Select1-on-1 chat reception(1對1聊天接收)


Integration complete

At this point, LINE Notify will send a notification indicating that the binding was successful.


Web example

At the same time, the browser will be redirected to /notify/check with the code and state information included.


Test content

Route

  • GET /
    • User clicks on the binding screen.
  • GET /callback
    • The callback route after LINE Notify settings and authentication completion.
  • Route for sending push notifications (due toCORS issues, an API is needed to forward the requests).
    • POST /notify/send
    • POST /notify/send_sticker
    • POST /notify/send_url
    • POST /notify/send_path
    • POST /notify/revoke

License

MIT