Supported Lead Sources
IndiaMART
The poller calls:INDIAMART_NEW_ONLY_MODE=true, the code calls the API without explicit start/end timestamps after initialization, using IndiaMART’s new-lead cursor behavior.
Stored fields:
phonefromSENDER_MOBILEnamefromSENDER_NAMEemailfromSENDER_EMAILproduct_namefromQUERY_PRODUCT_NAMEcityfromSENDER_CITYstatefromSENDER_STATEquery_messagefromQUERY_MESSAGE
Facebook Webhooks
Webhook endpoint:GET endpoint handles Facebook verification. The POST endpoint handles events.
If FACEBOOK_APP_SECRET is configured, the app verifies X-Hub-Signature-256.
Facebook Lead Ads
When Facebook sends aleadgen event, the app fetches the lead via Graph API and stores:
phonenameemailsource='facebook_ads'
Facebook Page Messages
For Page messages, the app attempts to fetch the sender phone number through Graph API. If no phone is available, it stores:fb_psid_... values. It marks those leads failed because they do not contain a real phone number.
CSV Upload
The Streamlit dashboard supports CSV lead upload. Required columns:namephone
sourceemailproduct_namecitystatequery_message
_clean_source_value() function.