Skip to main content

Python SDK for the SignalHouse API

Project description

SignalHouse Python SDK

Python SDK for the SignalHouse API — manage SMS/MMS messaging, phone numbers, 10DLC brands & campaigns, billing, and more.

Installation

pip install signalhouse

Or install from source:

pip install -e .

Quick Start

from signalhouse import SignalHouseSDK

# Initialize the SDK
sdk = SignalHouseSDK(
    api_key="your-api-key",
    base_url="https://v2.signalhouse.io",
)

# Send an SMS
response = sdk.messages.send_sms(
    sender_phone_number="15551234567",
    recipient_phone_numbers="15559876543",
    message_body="Hello from SignalHouse!",
)

if response["success"]:
    print("Message sent!", response["data"])
else:
    print("Error:", response["error"])

Authentication

All methods accept an optional token parameter to override the default API key per-request:

response = sdk.billing.get_wallet("G12345678", token="user-jwt-token")

Domains

The SDK is organized into domain modules matching the SignalHouse API:

Domain Description
sdk.auth Login, password reset, auth history
sdk.billing Wallets, payment methods, funds, invoices, fees
sdk.brands 10DLC brand registration and management
sdk.campaigns 10DLC campaign management
sdk.groups Group management
sdk.landings Landing page management (with file uploads)
sdk.messages Send SMS/MMS/Group MMS, message logs, analytics
sdk.notifications Notification management
sdk.numbers Phone number purchase, assignment, transfer, lookup
sdk.shortlinks URL shortlink operations
sdk.subgroups Subgroup management
sdk.subscriptions Subscription management
sdk.users User and service user management
sdk.webhooks Webhook management

Admin Methods

Some domains have admin-only methods accessible via the .admin sub-object. Enable them by passing enable_admin=True:

sdk = SignalHouseSDK(
    api_key="your-api-key",
    base_url="https://v2.signalhouse.io",
    enable_admin=True,
)

# Admin-only: approve a campaign
response = sdk.campaigns.admin.approve_campaign("campaign-id", token="admin-token")

# Admin-only: list all groups
response = sdk.groups.admin.get_groups(page=1, limit=20, token="admin-token")

Domains with admin sub-objects: campaigns, groups, subscriptions, users.

Response Format

All methods return a standardized dictionary:

Success:

{"success": True, "data": {...}, "status": 200}

Error:

{"success": False, "error": "Error message", "status": 400}

File Uploads

The landings and messages domains support multipart file uploads:

# Create a landing page with a logo
with open("logo.png", "rb") as f:
    response = sdk.landings.create_landing(
        landing_data={
            "brandId": "brand-id",
            "description": "My landing page",
            "primaryBackgroundColor": "#FFFFFF",
            "secondaryBackgroundColor": "#F0F0F0",
            "primaryTextColor": "#000000",
            "secondaryTextColor": "#333333",
        },
        file=("logo.png", f, "image/png"),
    )

# Send an MMS with images
with open("photo.jpg", "rb") as img:
    response = sdk.messages.send_mms(
        sender_phone_number="15551234567",
        recipient_phone_numbers=["15559876543"],
        message_body="Check this out!",
        images=[("photo.jpg", img, "image/jpeg")],
    )

Error Handling

from signalhouse import SignalHouseSDK, SignalHouseValidationError

sdk = SignalHouseSDK(api_key="your-key", base_url="https://v2.signalhouse.io")

try:
    # This will raise SignalHouseValidationError because group_id is required
    sdk.billing.get_wallet("")
except SignalHouseValidationError as e:
    print(f"Validation error: {e.message}")  # "Missing required parameter: groupId"

Requirements

  • Python 3.10+
  • requests >= 2.28.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signalhouse-1.0.1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signalhouse-1.0.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file signalhouse-1.0.1.tar.gz.

File metadata

  • Download URL: signalhouse-1.0.1.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for signalhouse-1.0.1.tar.gz
Algorithm Hash digest
SHA256 043a4280afd7acc2805479a969bec1c0bad87aa21df64a9b401db161681e82c4
MD5 e7cdbdf42cee5ce605c1308705600def
BLAKE2b-256 cc1e31e713ad89e0feaa5162f1b879c38f3fa095a6e70d7557e24f08fe3a2029

See more details on using hashes here.

File details

Details for the file signalhouse-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: signalhouse-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for signalhouse-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbae848359ddcf597f99022769476027fbcf12b658b6a13ef326000193e8a60f
MD5 be08ac2c04a406cd4a21e3ad59d901c5
BLAKE2b-256 3ab6f0671a95c0c42ca0c6a53aff6c7cd90a4195dfa0903dc9fdcfed5ca85d32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page