-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webhook got data even if the user didnt send a msg #48
Comments
|
Hello @rinab301 Can you please clarify more on how those two lines leads to a bug ? |
The problem is not super clear to me. And can have two causes.
What exactly do your changed line of code do? |
This might be related to #63 |
I found out that sometimes Facebook sends me a verification payload even after the first verification. This verification payload doesn't contain any message data, just the verification stuff. Idk if this is related. |
hi,
I am writing in python a webhook to use in my meta whatsapp app.
The webhook is called even if the user didnt send any messages. (It prints "Received webhook data" from the code below and continue).
What do I need to change in this code to make sure the webhook really got a message and not some other request from whatsapp? which condition do I need to check in the request\data and do return if its not a real message? or change somthing in the changed_field condition?
Thank you
@app.route("/", methods=["GET", "POST"])
def hook():
code...
code...
# Handle Webhook Subscriptions
data = request.get_json()
logging.info("Received webhook data: %s", data)
changed_field = messenger.changed_field(data)
if changed_field == "messages":
where changed_field is:
return data["entry"][0]["changes"][0]["field"]
...
...
The text was updated successfully, but these errors were encountered: