whats-this-payload

Easily identify payload message type from popular webhooks


License
MIT
Install
pip install whats-this-payload==1.2.4

Documentation

whats-this-payload

Build Status black-python-styleguide


Inspiration

Working with payload from webhooks can be really anoying. This tries to make the process easier.

How to run?

  • Create a virtual environment
  • Activate the environment
  • run make install env=dev

Install

pip install whats-this-payload

Basic usage

from whats_this_payload import get_identifier

whatsapp_identifier = get_identifier(webhook="whatsapp") # or any other available integration.

webhook_payload_as_dict = payload.dict()

payload_type = whatsapp_identifier(
    payload=webhook_payload_as_dict
).identify_payload_type()

print(payload_type)
# >> PayloadType.ANSWER_FROM_LIST_MESSAGE

# Supported payloads 
# (https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/payload-examples#list-messages)