Rich Communication Services with cards, carousels, and buttons
Styled messages
Images + buttons
Product browsing
Share locations
X-Smsly-Key-Id: sk_live_xxx
X-SMSLY-SDK-KEY: sdk_live_xxx
from smsly import SMSly
# === DUAL KEY SECURITY ===
# Two keys required (both can be in .env or embedded):
# 1. API Key - for authentication
# 2. SDK Key - for SDK validation
client = SMSly(
api_key="setup_api_your_key", # From dashboard
sdk_key="setup_sdk_your_key" # From dashboard
)
# Send RCS text message (type REQUIRED)
response = client.rcs.transactional(
to="+1234567890",
message="Welcome to RCS messaging! 🎉"
)
print(f"Message ID: {response.message_id}")
# Send Rich Card (marketing)
client.rcs.marketing(
to="+1234567890",
card={
"title": "Summer Sale",
"description": "50% off all items!",
"media_url": "https://example.com/sale.jpg",
"buttons": [
{"text": "Shop Now", "url": "https://yourstore.com"},
{"text": "Call Us", "phone": "+1234567890"}
]
}
)
# Send Carousel
client.rcs.carousel(
to="+1234567890",
cards=[
{"title": "Product 1", "media_url": "...", "price": "$29"},
{"title": "Product 2", "media_url": "...", "price": "$39"},
{"title": "Product 3", "media_url": "...", "price": "$49"}
]
)
# === METHOD 2: Environment Variables ===
client = SMSly() # Auto-reads from env/v1/rcs/sendSend RCS message/v1/rcs/cardSend rich card/v1/rcs/carouselSend carousel/v1/rcs/:idGet RCS status