📱 Contact Sharing Webhook

Share contact information instantly with QR codes! Python Flask webhook with support for vCard, JSON, and custom formats.

Python Flask vCard
Configure Webhook Full Documentation

Key Features

  • Multiple Formats - vCard, JSON, URL, and custom pipe-delimited formats
  • vCard Support - Full vCard 3.0/4.0 parsing and generation
  • Contact Validation - Automatic data validation and formatting
  • QR Code Generation - Create QR codes for any contact
  • Rich Display - Formatted contact information with icons
  • Activity Logging - Track contact sharing activity
  • Privacy Focused - No unnecessary data storage
  • Mobile Optimized - Perfect for smartphone workflows

Supported Contact Formats

1 vCard Format - Standard vCard format (most compatible)
BEGIN:VCARD VERSION:3.0 FN:John Smith N:Smith;John;;; ORG:Acme Corporation TITLE:Software Engineer TEL;TYPE=VOICE:+1-555-123-4567 EMAIL;TYPE=INTERNET:john.smith@acme.com URL:https://johnsmith.dev END:VCARD
2 JSON Format - Structured JSON contact data
{ "name": "John Smith", "company": "Acme Corporation", "title": "Software Engineer", "phone": "+1-555-123-4567", "email": "john.smith@acme.com", "website": "https://johnsmith.dev" }
3 Pipe-Delimited Format - Simple format: NAME|PHONE|EMAIL|COMPANY
John Smith|+1-555-123-4567|john.smith@acme.com|Acme Corporation
4 Contact URLs - Links to contact sharing services
https://contacts.example.com/share/john-smith

Usage Examples

👤 vCard Contact

When scanning a vCard QR code:

👤 John Smith 🏢 Software Engineer at Acme Corporation 📱 Mobile: +1-555-123-4567 📧 Email: john.smith@acme.com 🌐 Website: https://johnsmith.dev ✅ Contact information scanned successfully! 📱 Save to your contacts app

📋 JSON Contact

For JSON format contacts:

👤 Sarah Johnson 🏢 Marketing Director at TechCorp 📞 Phone: +1-555-987-6543 📧 Email: sarah.j@techcorp.com 📍 Address: 123 Business St, City, State 📝 Notes: Met at Tech Conference 2024 ✅ Contact information scanned successfully! 📱 Save to your contacts app

❓ Unknown Format

For unrecognized QR codes:

❓ Unknown Contact Format This QR code is not recognized as a contact. Supported formats: • vCard (BEGIN:VCARD) • Contact URLs • JSON contact data

Quick Start

1. Installation

# Install Python dependencies pip install -r requirements.txt # Copy environment configuration cp .env.example .env

2. Configuration

Edit .env file with your settings:

FLASK_ENV=development SECRET_KEY=your-super-secret-key PORT=5001

3. Start the Server

# Development mode python contact-sharing-webhook.py # Production mode with Gunicorn gunicorn -w 4 -b 0.0.0.0:5001 contact-sharing-webhook:app

4. Configure AllCodeRelay

Use the configuration tool to generate a QR code with your webhook URL:

http://your-server:5001/webhook
Note: The webhook processes contacts in memory only - no database setup required for basic functionality.

API Endpoints

Webhook Endpoint
  • POST /webhook - Main AllCodeRelay webhook
  • Body: {"code": "BEGIN:VCARD..."}
Utility Endpoints
  • POST /generate-vcard - Generate vCard from JSON data
  • POST /generate-qr - Generate QR code for contact data
  • GET /health - Health check and status
Generate vCard Example
curl -X POST http://localhost:5001/generate-vcard \ -H "Content-Type: application/json" \ -d '{ "name": "John Smith", "phone": "+1-555-123-4567", "email": "john@example.com", "company": "Acme Corp" }'

Contact Data Structure

📋 Complete Contact Object
contact = { 'name': 'John Smith', 'phones': [ {'type': 'Mobile', 'number': '+1-555-123-4567'}, {'type': 'Work', 'number': '+1-555-987-6543'} ], 'emails': [ {'type': 'Personal', 'address': 'john@personal.com'}, {'type': 'Work', 'address': 'john@company.com'} ], 'company': 'Acme Corporation', 'title': 'Software Engineer', 'address': '123 Main St, City, State 12345', 'website': 'https://johnsmith.dev', 'notes': 'Met at Tech Conference 2024' }
📞 Supported Phone Types
  • Mobile/Cell
  • Work
  • Home
  • Fax
  • Pager
📧 Supported Email Types
  • Personal
  • Work
  • Home
  • Other

Advanced Features

🔒 Privacy Features
  • No Storage - Contacts are not stored by default
  • Anonymized Logs - Personal data can be excluded from logs
  • Secure Processing - All data is processed in memory only
✅ Contact Validation

The webhook automatically validates:

  • Phone number formats
  • Email address syntax
  • Required fields (name, phone or email)
  • Data size limits
🔗 Integration Examples

Extend the webhook to integrate with:

Files Included

Core Files
  • contact-sharing-webhook.py - Main webhook script
  • requirements.txt - Python dependencies
  • .env.example - Environment configuration
  • contact-sharing-README.md - Complete documentation
Features
  • vCard parsing and generation
  • QR code creation utilities
  • Multiple format support
  • Production-ready with Gunicorn

Get Started

Ready to enable contact sharing with AllCodeRelay?

Download Webhook Script Download Requirements Download Config Template View Full Documentation
Back to Gallery Main Site