Expand description
§Sendly Rust SDK
Official Rust client for the Sendly SMS API.
§Quick Start
use sendly::{Sendly, SendMessageRequest};
#[tokio::main]
async fn main() -> Result<(), sendly::Error> {
let client = Sendly::new("sk_live_v1_your_api_key");
let message = client.messages().send(SendMessageRequest {
to: "+15551234567".to_string(),
text: "Hello from Sendly!".to_string(),
}).await?;
println!("Message sent: {}", message.id);
Ok(())
}§Webhooks Management
use sendly::Sendly;
#[tokio::main]
async fn main() -> Result<(), sendly::Error> {
let client = Sendly::new("sk_live_v1_your_api_key");
// Create a webhook
let response = client.webhooks().create(
"https://example.com/webhook",
vec!["message.delivered", "message.failed"],
).await?;
println!("Webhook secret: {}", response.secret);
Ok(())
}§Account & Credits
use sendly::Sendly;
#[tokio::main]
async fn main() -> Result<(), sendly::Error> {
let client = Sendly::new("sk_live_v1_your_api_key");
let credits = client.account().credits().await?;
println!("Available credits: {}", credits.available_balance);
Ok(())
}Modules§
- webhooks
- Sendly Webhook Helpers
Structs§
- Account
- Account information.
- Account
Limits - Account rate limits.
- Account
Resource - Account resource for managing account information and credits.
- Account
Verification - Account verification status.
- ApiKey
- An API key.
- Batch
List - Paginated list of batches.
- Batch
Message Item - A single message in a batch request.
- Batch
Message Response - Response from sending batch messages.
- Batch
Message Result - Result of a single message in a batch.
- Cancel
Scheduled Message Response - Response from cancelling a scheduled message.
- Create
ApiKey Request - Request to create an API key.
- Create
ApiKey Response - Response from creating an API key.
- Create
Webhook Request - Request to create a webhook.
- Credit
Transaction - A credit transaction.
- Credit
Transaction List - List of credit transactions.
- Credits
- Credit balance information.
- List
Batches Options - Options for listing batches.
- List
Deliveries Options - Options for listing webhook deliveries.
- List
Messages Options - Options for listing messages.
- List
Scheduled Messages Options - Options for listing scheduled messages.
- List
Transactions Options - Options for listing transactions.
- Message
- An SMS message.
- Message
List - Paginated list of messages.
- Messages
- Messages resource for sending and managing SMS.
- Schedule
Message Request - Request to schedule an SMS message.
- Scheduled
Message - A scheduled SMS message.
- Scheduled
Message List - Paginated list of scheduled messages.
- Send
Batch Request - Request to send batch messages.
- Send
Message Request - Request to send an SMS message.
- Sendly
- Sendly API client.
- Sendly
Config - Configuration for the Sendly client.
- Update
Webhook Request - Request to update a webhook.
- Webhook
- A webhook configuration.
- Webhook
Created Response - Response from creating a webhook (includes secret).
- Webhook
Delivery - A webhook delivery attempt.
- Webhook
Delivery List - List of webhook deliveries.
- Webhook
Secret Rotation - Response from rotating a webhook secret.
- Webhook
Test Result - Result from testing a webhook.
- Webhooks
Resource - Webhooks resource for managing webhook endpoints.
Enums§
- Batch
Status - Status of a message batch.
- Circuit
State - Circuit breaker state for webhooks.
- Error
- Errors that can occur when using the Sendly SDK.
- Message
Direction - Message direction.
- Message
Status - Message delivery status.
- Scheduled
Message Status - Status of a scheduled message.
- Sender
Type - Sender type.
- Transaction
Type - Credit transaction type.
Type Aliases§
- Result
- Result type for Sendly operations.