{"id":51399715,"url":"https://github.com/android-sms-gateway/example-webhooks-flask","last_synced_at":"2026-07-04T05:14:43.588Z","repository":{"id":368123307,"uuid":"966658347","full_name":"android-sms-gateway/example-webhooks-flask","owner":"android-sms-gateway","description":"📨 Example Flask SMS Gateway Webhook Processor | HMAC Security + Pydantic Validation | Auto-Registration","archived":false,"fork":false,"pushed_at":"2026-06-29T05:15:54.000Z","size":27,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-29T07:10:38.240Z","etag":null,"topics":["example","flask-application","sms-gate","sms-gateway","webhook-integration"],"latest_commit_sha":null,"homepage":"https://docs.sms-gate.app/features/webhooks/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/android-sms-gateway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-15T08:59:55.000Z","updated_at":"2026-06-29T05:15:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/android-sms-gateway/example-webhooks-flask","commit_stats":null,"previous_names":["android-sms-gateway/example-webhooks-flask"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/android-sms-gateway/example-webhooks-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android-sms-gateway%2Fexample-webhooks-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android-sms-gateway%2Fexample-webhooks-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android-sms-gateway%2Fexample-webhooks-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android-sms-gateway%2Fexample-webhooks-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/android-sms-gateway","download_url":"https://codeload.github.com/android-sms-gateway/example-webhooks-flask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android-sms-gateway%2Fexample-webhooks-flask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35110679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","flask-application","sms-gate","sms-gateway","webhook-integration"],"created_at":"2026-07-04T05:14:41.528Z","updated_at":"2026-07-04T05:14:43.583Z","avatar_url":"https://github.com/android-sms-gateway.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📱 Example SMS Webhook Processor (Flask)\n\n[![Example](https://img.shields.io/badge/Type-Example%20Project-orange.svg)](https://github.com/android-sms-gateway/example-webhooks-flask)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Python](https://img.shields.io/badge/Python-3.9%2B-brightgreen.svg)](https://www.python.org/)\n[![Flask](https://img.shields.io/badge/Framework-Flask-%23000000.svg)](https://flask.palletsprojects.com/)\n\n\u003e **⚠️ Example Project Notice**  \n\u003e Not intended for production use without proper security review and modifications.\n\n## 📋 Table of Contents\n- [📱 Example SMS Webhook Processor (Flask)](#-example-sms-webhook-processor-flask)\n  - [📋 Table of Contents](#-table-of-contents)\n  - [✨ About The Project](#-about-the-project)\n    - [🛠️ Built With](#️-built-with)\n    - [⚠️ Important Notes](#️-important-notes)\n  - [🚀 Getting Started](#-getting-started)\n    - [📦 Prerequisites](#-prerequisites)\n    - [⚡ Installation](#-installation)\n  - [⚙️ Configuration](#️-configuration)\n  - [🖥️ Usage](#️-usage)\n  - [📚 API Reference](#-api-reference)\n    - [`POST /webhook/sms-received`](#post-webhooksms-received)\n  - [🤝 Contributing](#-contributing)\n  - [📜 License](#-license)\n\n## ✨ About The Project\n\n**Example Project Features**:\n- 🧩 Demonstrates webhook registration/deregistration lifecycle\n- 🔐 Example HMAC signature validation implementation\n- 📝 Sample payload validation using Pydantic models\n- 🔄 Synchronous Flask implementation\n\n### 🛠️ Built With\n\n- 🚀 [Flask](https://flask.palletsprojects.com/) - Lightweight Python web framework\n- ✔️ [Pydantic](https://pydantic.dev/) - Data validation and settings management\n- 🌐 [HTTPX](https://www.python-httpx.org/) - Synchronous HTTP client\n\n### ⚠️ Important Notes\n\n**This example intentionally omits**:\n\n- Production-grade error handling\n- Rate limiting\n- Persistent storage integration\n- Advanced security features\n\n**Recommended for**:\n\n- 🧪 Testing SMS Gate webhook integration\n- 🎓 Learning Flask webhook implementations\n\n## 🚀 Getting Started\n\n### 📦 Prerequisites\n\n- Python 3.9+ (development environment)\n- Valid SSL certificate ([project's CA](https://docs.sms-gate.app/services/ca/) available) or reverse proxy (like [ngrok](https://ngrok.com/))\n- SMS Gate credentials\n\n### ⚡ Installation\n\n1. Clone the example repository:\n    ```bash\n    git clone https://github.com/android-sms-gateway/example-webhooks-flask.git\n    cd example-webhooks-flask\n    ```\n\n2. Install dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n3. Create environment file:\n    ```bash\n    cp .env.example .env\n    ```\n\n## ⚙️ Configuration\n\n**Example `.env` configuration**:\n```ini\n# 🔑 Example SMS Gate API Credentials\nFLASK_SMS_GATE_API_URL=\"https://api.sms-gate.app/3rdparty/v1\" # API root endpoint (optional)\nFLASK_SMS_GATE_API_USERNAME=\"test_user\"                       # API username\nFLASK_SMS_GATE_API_PASSWORD=\"test_password\"                   # API password\n\n# 🔒 Example Webhook Security\nFLASK_WEBHOOK_SECRET=\"your_test_secret_here\"                      # signing key (optional)\nFLASK_WEBHOOK_URL=\"https://localhost:8443/webhook/sms-received\"   # current server endpoint\n\n# 🛡️ SSL Configuration\nFLASK_SSL_CERT_PATH=\"./certs/server.crt\"  # SSL certificate (optional)\nFLASK_SSL_KEY_PATH=\"./certs/server.key\"   # SSL private key (optional)\n```\n\n## 🖥️ Usage\n\n**Run the server**:\n```bash\npython app.py\n```\n\n**Expected output**:\n```plaintext\nRegistered webhook ID: 6GlbDer5u83MLiupOKXxf\n * Serving Flask app 'main'\n * Debug mode: off\nWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.\n * Running on all addresses (0.0.0.0)\n * Running on http://127.0.0.1:8080\n * Running on http://10.10.0.2:8080\nPress CTRL+C to quit\nReceived SMS:\nSIM: 1\nFrom: ******1212\nMessage: Android is always a sweet treat!\nReceived at: 2025-04-15 15:50:56+07:00\n127.0.0.1 - - [15/Apr/2025 15:50:59] \"POST /webhook/sms-received HTTP/1.1\" 200 -\n^CUnregistered webhook ID: 6GlbDer5u83MLiupOKXxf\n```\n\n## 📚 API Reference\n\n### `POST /webhook/sms-received`\n\n**Example Request**:\n```bash\ncurl -X POST https://localhost:8443/webhook/sms-received \\\n  -H \"X-Signature: abc123...\" \\\n  -H \"X-Timestamp: 1690123456\" \\\n  -d @sample_payload.json\n```\n\n**Example Response**:\n```json\n{\n  \"status\": \"ok\"\n}\n```\n\n## 🤝 Contributing\n\nThis example project welcomes contributions to:\n\n- Improve documentation\n- Demonstrate additional features\n- Enhance example security implementations\n\n## 📜 License\n\nThis example code is released under [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid-sms-gateway%2Fexample-webhooks-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroid-sms-gateway%2Fexample-webhooks-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid-sms-gateway%2Fexample-webhooks-flask/lists"}