Skip to content

Commit 86480b4

Browse files
Merge pull request #6 from Devotel/feature/omni-channel-messaging
feat: implement omni-channel messaging endpoint
2 parents 1faa0c4 + d8435aa commit 86480b4

7 files changed

Lines changed: 977 additions & 36 deletions

File tree

examples/README.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This directory contains comprehensive examples for using the Devo Global Communi
66

77
### 🚀 Overview
88
- **`basic_usage.py`** - Interactive overview and launcher for all examples
9+
- **`omni_channel_example.py`** - ✅ **Complete Omni-channel Messaging** - Unified API for all channels
910

1011
### 📱 Communication Resources
1112
- **`sms_example.py`** - ✅ **Complete SMS API implementation**
@@ -14,9 +15,14 @@ This directory contains comprehensive examples for using the Devo Global Communi
1415
- Search and purchase phone numbers
1516
- Legacy compatibility methods
1617

18+
- **`rcs_example.py`** - ✅ **Complete RCS API implementation**
19+
- Account management and messaging operations
20+
- Template and brand management
21+
- Tester management and capability testing
22+
- Rich messaging features (cards, carousels, suggestions)
23+
1724
- **`email_example.py`** - 🚧 **Placeholder** (Email functionality)
1825
- **`whatsapp_example.py`** - 🚧 **Placeholder** (WhatsApp functionality)
19-
- **`rcs_example.py`** - 🚧 **Placeholder** (RCS functionality)
2026

2127
### 👥 Management Resources
2228
- **`contacts_example.py`** - 🚧 **Placeholder** (Contact management)
@@ -47,14 +53,62 @@ This provides an interactive menu to choose and run specific examples.
4753

4854
#### Option 2: Run Individual Examples
4955
```bash
56+
# Omni-channel messaging (fully implemented)
57+
python examples/omni_channel_example.py
58+
5059
# SMS functionality (fully implemented)
5160
python examples/sms_example.py
5261

62+
# RCS functionality (fully implemented)
63+
python examples/rcs_example.py
64+
5365
# Other resources (placeholder examples)
5466
python examples/email_example.py
5567
python examples/whatsapp_example.py
5668
python examples/contacts_example.py
57-
python examples/rcs_example.py
69+
```
70+
71+
## 🌐 Omni-channel Messaging Examples (Fully Implemented)
72+
73+
The unified messaging resource provides a single API endpoint to send messages through any channel:
74+
75+
### 🔧 Available Functions
76+
1. **Send Message** - `client.messages.send()`
77+
- Uses POST `/api/v1/user-api/messages/send`
78+
- Supports SMS, Email, WhatsApp, and RCS channels
79+
- Channel-specific payload flexibility
80+
- Unified response format
81+
82+
### 💡 Key Features
83+
- **Unified Interface**: One endpoint for all channels
84+
- **Channel-specific Payloads**: Flexible payload structure for each channel
85+
- **Type Safety**: Full Pydantic model validation
86+
- **Metadata Support**: Custom metadata and webhook URLs
87+
- **Bulk Messaging**: Easy iteration across multiple channels
88+
89+
### 📝 Example Usage
90+
```python
91+
from devo_global_comms_python.models.messages import SendMessageDto
92+
93+
# Send SMS
94+
sms_data = SendMessageDto(
95+
channel="sms",
96+
to="+1234567890",
97+
payload={"text": "Hello World"}
98+
)
99+
result = client.messages.send(sms_data)
100+
101+
# Send Email
102+
email_data = SendMessageDto(
103+
channel="email",
104+
to="user@example.com",
105+
payload={
106+
"subject": "Test Email",
107+
"text": "Hello World",
108+
"html": "<h1>Hello World</h1>"
109+
}
110+
)
111+
result = client.messages.send(email_data)
58112
```
59113

60114
## 📱 SMS Examples (Fully Implemented)

0 commit comments

Comments
 (0)