Neurotech-HQ/heyoo

Key error in changed_field for webhook

dim3003 opened this issue · 3 comments

I am testing the application and I used the whatsapp api webhook tests but the messenger.changed_field function fails to catch the data:

webhook data: {'entry': [{'id': '0', 'time': 1675274553, 'uid': '0', 'changed_fields': ['location']}], 'object': 'user'} {'entry': [{'id': '0', 'time': 1675274553, 'uid': '0', 'changed_fields': ['location']}], 'object': 'user'}

With this function:

return data["entry"][0]["changes"][0]["field"]

Shouldn't it be:

return data["entry"][0]["changed_fields"][0] ?

Hey @dim3003

I cannot seem to be able to reproduce your issue. Can you elaborate for me on what scenario you receive a webhook like that?

My bad I was launching tests from the wrong webhook. Everything works perfectly retried it with message. Awesome work btw.

Cool, I will now close this issue