Webhook callback failed · Issue #145 · lineline | linebot.exceptions.linebotapierror: linebotapierro
Iamdeployingtheexamplarbotfromreadme.rstasanexperimentalruntotothecloud,butthecallbackfunctionkeepsjumptoexceptandreturnsinvalidreplytokenerrorThewebhookreturnedaninvalidHTTPstatuscode.(Theexpectedstatuscodeis200.)importsysfromflaskimportFlask,request,abortfromlinebotimport(LineBotApi,WebhookHandler)fromlinebot.exceptionsimport(InvalidSignatureError)fromlinebot.modelsimport(MessageEvent,TextMessage,TextSendMessage,)app=Flask(__name__)line_bot_api=LineBotApi(Obe1lI7DmlcB/Q3fBR+CmzmlwaTGR0Uubw...
I am deploying the examplar bot from readme.rst as an experimental run to to the cloud, but the callback function keeps jump to except and returns invalid reply token error The webhook returned an invalid HTTP status code. (The expected status code is 200.)
import sys from flask import Flask, request, abort from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, ) app = Flask(__name__) line_bot_api = LineBotApi(Obe1lI7DmlcB/Q3fBR+CmzmlwaTGR0Uubwx9maohNFbA6O2TN1BrbHbkSeKWV3MHRM12TCNFV958z3Em/Muxe/XuIyEN+L0iph1XRt5X6/6kJrCWpnd4nC4pKk9kkq0kn5HjY5s01dxqQ2993LOQBQdB04t89/1O/w1cDnyilFU=) handler = WebhookHandler(f8377fb5e1f26314ae2162fe6f2997c5) @app.route("/callback", methods=[GET, POST]) def callback(): # get X-Line-Signature header value signature = request.headers[X-Line-Signature] # get request body as text body ...