Crate sendly

Crate sendly 

Source
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.
AccountLimits
Account rate limits.
AccountResource
Account resource for managing account information and credits.
AccountVerification
Account verification status.
ApiKey
An API key.
BatchList
Paginated list of batches.
BatchMessageItem
A single message in a batch request.
BatchMessageResponse
Response from sending batch messages.
BatchMessageResult
Result of a single message in a batch.
CancelScheduledMessageResponse
Response from cancelling a scheduled message.
CreateApiKeyRequest
Request to create an API key.
CreateApiKeyResponse
Response from creating an API key.
CreateWebhookRequest
Request to create a webhook.
CreditTransaction
A credit transaction.
CreditTransactionList
List of credit transactions.
Credits
Credit balance information.
ListBatchesOptions
Options for listing batches.
ListDeliveriesOptions
Options for listing webhook deliveries.
ListMessagesOptions
Options for listing messages.
ListScheduledMessagesOptions
Options for listing scheduled messages.
ListTransactionsOptions
Options for listing transactions.
Message
An SMS message.
MessageList
Paginated list of messages.
Messages
Messages resource for sending and managing SMS.
ScheduleMessageRequest
Request to schedule an SMS message.
ScheduledMessage
A scheduled SMS message.
ScheduledMessageList
Paginated list of scheduled messages.
SendBatchRequest
Request to send batch messages.
SendMessageRequest
Request to send an SMS message.
Sendly
Sendly API client.
SendlyConfig
Configuration for the Sendly client.
UpdateWebhookRequest
Request to update a webhook.
Webhook
A webhook configuration.
WebhookCreatedResponse
Response from creating a webhook (includes secret).
WebhookDelivery
A webhook delivery attempt.
WebhookDeliveryList
List of webhook deliveries.
WebhookSecretRotation
Response from rotating a webhook secret.
WebhookTestResult
Result from testing a webhook.
WebhooksResource
Webhooks resource for managing webhook endpoints.

Enums§

BatchStatus
Status of a message batch.
CircuitState
Circuit breaker state for webhooks.
Error
Errors that can occur when using the Sendly SDK.
MessageDirection
Message direction.
MessageStatus
Message delivery status.
ScheduledMessageStatus
Status of a scheduled message.
SenderType
Sender type.
TransactionType
Credit transaction type.

Type Aliases§

Result
Result type for Sendly operations.