Q&A

Feeding LINE Bot with text from outside and send Push Message to user with a 400 bad request?

Pre condition, Condition to reproduce

Hi Everyone, Here is my nackground scenario, I'm trying to use line bot as a warning alert reminder, Once there is a warning event, line bot should send a warning message to user What I've tried: I've tried to send a message content with Postman to my Line bot webhook, which the message content was in JSON format. The message content includes the warning text I want to send to user and the user ID, In the Python line bot program, I've wrote that if a http request was sent from Postman to webhook, Then line bot should send the messeage to the user via push message.

Issue/ Error Message details

As I sent the HTTP Post request from Postman, The user could recieve the message successfully, However, Postman showed a 400 bad request. What could be wrong? Why is there a 400 bad request even the message sent to the user successfully? Is it because I'm using a wrong X-LINE-Signature? But I've already cheched the X-LINE-Signature(channel secret) from line developer Can anyone Help?

Accompanying respective source code

Resolution Tried

Reference information (Version / Platform/ environment)

HTTP Request Source: Postman Line bot: Python application Published on Heroku

  • 0
  • 1
  • 1545
  • X(旧Twitter) facebook

Probably you use sdk and it checks X-LINE-Signature. In this case, you should add another endpoint for your first webhook for the alert event. The endpoint doesn't check X-LINE-Signature (because the webhook doesn't have it) and checks another signature to avoid security issue.

  • 0

Similar posts

    No similar posts

Are you sure? question.vm