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(),
        message_type: None,
    }).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.
BatchPreviewItem
A single message in a batch preview.
BatchPreviewResponse
Response from previewing a batch (dry run).
CancelScheduledMessageResponse
Response from cancelling a scheduled message.
CheckVerificationRequest
CheckVerificationResponse
CreateApiKeyRequest
Request to create an API key.
CreateApiKeyResponse
Response from creating an API key.
CreateSessionRequest
CreateTemplateRequest
CreateWebhookRequest
Request to create a webhook.
CreditTransaction
A credit transaction.
CreditTransactionList
List of credit transactions.
Credits
Credit balance information.
DeleteTemplateResponse
ListBatchesOptions
Options for listing batches.
ListDeliveriesOptions
Options for listing webhook deliveries.
ListMessagesOptions
Options for listing messages.
ListScheduledMessagesOptions
Options for listing scheduled messages.
ListTemplatesOptions
ListTransactionsOptions
Options for listing transactions.
ListVerificationsOptions
Message
An SMS message.
MessageList
Paginated list of messages.
Messages
Messages resource for sending and managing SMS.
Pagination
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.
SendVerificationRequest
SendVerificationResponse
Sendly
Sendly API client.
SendlyConfig
Configuration for the Sendly client.
SessionsResource
Template
TemplateList
TemplatePagination
TemplatesResource
UpdateTemplateRequest
UpdateWebhookRequest
Request to update a webhook.
ValidateSessionRequest
ValidateSessionResponse
Verification
VerificationList
VerifyResource
VerifySession
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.
Channel
CircuitState
Circuit breaker state for webhooks.
DeliveryStatus
Error
Errors that can occur when using the Sendly SDK.
MessageDirection
Message direction.
MessageStatus
Message delivery status.
MessageType
Message type for compliance handling.
ScheduledMessageStatus
Status of a scheduled message.
SenderType
Sender type.
SessionStatus
TemplateType
TransactionType
Credit transaction type.
VerificationStatus
WebhookMode
Webhook mode for event filtering.

Type Aliases§

Result
Result type for Sendly operations.