Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mereth SMS API

A FastAPI application for sending SMS messages via Clicksend.

Features

  • 📱 Send SMS messages
  • 🔄 Update message status
  • 🚫 Unsubscribe phone numbers
  • 👀 View message history
  • ⚙️ YAML-based configuration

Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure Clicksend Credentials

Edit config.yaml and add your Clicksend credentials:

clicksend:
  username: "your_clicksend_username"
  api_key: "your_clicksend_api_key"

3. Run the Application

python main.py

Or with uvicorn directly:

uvicorn main:app --reload --host 0.0.0.0 --port 8000

The API will be available at http://localhost:8000

API Endpoints

1. Send SMS

POST /mereth/api/send

{
  "to": "+1234567890",
  "message": "Hello from Mereth SMS API!",
  "from_number": "YourSenderID"
}

2. Update Message Status

POST /mereth/api/update

{
  "message_id": "12345678-1234-1234-1234-123456789012"
}

3. Unsubscribe

POST /mereth/api/unsubscribe

{
  "phone_number": "+1234567890"
}

4. View Messages

POST /mereth/api/view

{
  "limit": 10
}

Testing with cURL

Send SMS

curl -X POST "http://localhost:8000/mereth/api/send" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+1234567890",
    "message": "Test message",
    "from_number": "YourSenderID"
  }'

View Messages

curl -X POST "http://localhost:8000/mereth/api/view" \
  -H "Content-Type: application/json" \
  -d '{"limit": 10}'

Interactive Documentation

Once running, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Notes

  • Phone numbers should be in E.164 format (e.g., +1234567890)
  • Messages are limited to 1600 characters
  • Make sure your Clicksend account has sufficient credits

Error Handling

The API includes comprehensive error handling and logging. Check console output for detailed error messages.

About

Event planning using YAML

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages