Skip to content

damarff/api-integration-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

API Integration Hub

Multi-platform API integration gateway built with FastAPI. Receive, transform, and relay data across Telegram, Slack, WhatsApp, e-mail, and arbitrary webhooks β€” all through a single HTTP service.

Tech Stack

  • Python 3.12+ β€” type-hinted throughout
  • FastAPI β€” async web framework with auto-generated OpenAPI / Swagger docs
  • httpx β€” async HTTP client for outbound API calls
  • Pydantic v2 β€” request/response validation and settings management
  • pydantic-settings β€” load config from environment variables / .env

Quick Start

# 1. Clone & enter
cd api-integration-hub

# 2. (Optional) Create virtual environment
python -m venv .venv && source .venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure secrets
cp .env.example .env
# Edit .env with your API keys (see comments inside)

# 5. Run
uvicorn main:app --reload

Open http://localhost:8000/docs for the Swagger UI β€” you can test every endpoint there.

Docker

docker compose up -d

Endpoints

Method Path Description
GET /health Health check
POST /webhook/receive Receive a generic webhook payload
POST /webhook/forward Forward a payload to an external webhook
POST /telegram/send Send a message via Telegram Bot API
POST /slack/notify Send a notification to Slack
POST /transform Map / transform data between formats

Example: Receive Trello webhook β†’ transform β†’ send to Slack

Step 1 β€” Point Trello webhook to your instance:

POST /webhook/receive

Trello sends its card-update payload here. The endpoint echoes back what it got so you can inspect the shape.

Step 2 β€” Transform the data:

POST /transform
{
  "template": {
    "card": "{card_name}",
    "list": "{list_after_name}",
    "url": "{short_url}"
  },
  "data": {
    "card_name": "Fix login bug",
    "list_after_name": "In Progress",
    "short_url": "https://trello.com/c/abc123"
  }
}

Response:

{
  "result": {
    "card": "Fix login bug",
    "list": "In Progress",
    "url": "https://trello.com/c/abc123"
  }
}

Step 3 β€” Forward the transformed data to Slack:

POST /slack/notify
{
  "text": "Card moved: *Fix login bug* β†’ _In Progress_\n<https://trello.com/c/abc123>",
  "channel": "#engineering"
}

Connectors

Module Service Requires
telegram Telegram Bot API TELEGRAM_BOT_TOKEN
slack Slack Incoming Webhook SLACK_WEBHOOK_URL
whatsapp WhatsApp Cloud API WHATSAPP_TOKEN, WHATSAPP_PHONE_ID
email SMTP SMTP_HOST, SMTP_USER, SMTP_PASS
webhook Generic HTTP relay β€” (any valid URL)

Environment Variables

See .env.example for the full list. Copy it to .env and fill in your credentials.

Project Structure

api-integration-hub/
β”œβ”€β”€ main.py              # FastAPI app β€” all endpoints
β”œβ”€β”€ config.py            # Pydantic Settings (reads .env)
β”œβ”€β”€ connectors/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ telegram.py      # Telegram Bot API wrapper
β”‚   β”œβ”€β”€ slack.py         # Slack webhook sender
β”‚   β”œβ”€β”€ whatsapp.py      # WhatsApp Cloud API wrapper
β”‚   β”œβ”€β”€ email.py         # SMTP e-mail sender
β”‚   └── webhook.py       # Generic webhook forwarder
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
β”œβ”€β”€ Dockerfile
└── docker-compose.yml

License

MIT β€” use freely for personal or commercial projects.

About

πŸ”— FastAPI multi-connector hub β€” Telegram, Slack, WhatsApp, Email, webhook relay. Async, type-hinted, Docker-ready. Plug and play.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors