clicksend-rs
Unofficial ClickSend SDK for Rust.
- async-first; optional
blockingfeature usesreqwest::blocking(no tokio leak) - namespaced API:
client.sms().send(),client.account().get() - redacted
Debug(api key never logged) - timeouts + user-agent + retry built into the builder
tracingspans on every request- webhook parsers for inbound SMS / delivery receipts
- escape hatch:
client.raw_request(method, path)for endpoints not yet wrapped
Install
[]
= "0.1"
# or with blocking:
= { = "0.1", = ["blocking"] }
Auth
ClickSend uses HTTP basic with username + api_key. Grab both from dashboard → API credentials.
Async
use ;
use Duration;
async
Blocking
use ;
let c = new;
let coll = new;
c.sms.price?;
Webhook parsing
use ;
// in your HTTP handler:
let inbound = parse_inbound_sms?;
let receipt = parse_delivery_receipt?;
Endpoints implemented
| Resource | Method | Path |
|---|---|---|
account().get() |
GET | /account |
sms().send() |
POST | /sms/send (costs money) |
sms().price() |
POST | /sms/price (free) |
sms().history() |
GET | /sms/history |
sms().receipts() |
GET | /sms/receipts |
sms().inbound() |
GET | /sms/inbound |
sms().cancel() |
PUT | /sms/{id}/cancel |
sms().cancel_all() |
PUT | /sms/cancel-all |
mms().send() |
POST | /mms/send |
voice().send() |
POST | /voice/send |
email().send() |
POST | /email/send |
ClickSend has ~30 more (campaigns, contacts, fax, post mail, subaccounts). For those, use the escape hatch:
let resp: = client
.raw_request
.send.await?
.json.await?;
Error handling
match c.sms.send.await
Live tests
All live tests are #[ignore] so they don't run by accident. sms_send costs money — gated.
License
0BSD.