#sms #messagebird


Wrapper around the message bird SMS API

15 releases

0.5.0 Mar 19, 2020
0.4.0 Jan 17, 2019
0.4.0-beta.1 Dec 27, 2018
0.3.1 Dec 1, 2018
0.0.4 Sep 18, 2018

#171 in Asynchronous

Download history 1/week @ 2020-11-08 15/week @ 2020-11-22 4/week @ 2020-11-29 13/week @ 2020-12-06 1/week @ 2020-12-20 15/week @ 2021-01-03 15/week @ 2021-01-17 29/week @ 2021-02-07 61/week @ 2021-02-14

62 downloads per month


2.5K SLoC


Build Status Crates.io docs.rs License

MessageBird is a service for sending SMS at its core https://www.messagebird.com/


Send a SMS Message

Sending a sms to a specified target is implemented in examples/send.rs:

export MESSAGEBIRD_ACCESSKEY=abio8usad..dfahdk
export SMS_RECIPIENT=1234556

The SMS_RECIPIENT should NOT contain leading zeros nor the +. The countrycode is still necessary.

cargo run --example send

or copy & paste:

extern crate log;
extern crate env_logger;
extern crate futures;
extern crate messagebird_async;
extern crate tokio_core;

use futures::future::Future;
use messagebird_async::errors::*;
use messagebird_async::sms;
use messagebird_async::sms::*;

fn main() -> Result<(), MessageBirdError> {

    let msisdn_str = std::env::var("SMS_RECIPIENT".to_string())
        .expect("SMS_RECIPIENT should contain the number without prefix");
    let msisdn: Msisdn = Msisdn::from_str(msisdn_str.as_str())
        .expect("SMS_RECIPIENT did not contain a valid number");

    info!("example: sending a message");
    let sendable = sms::send::SendParameters::builder()

    let accesskey = AccessKey::from_env()?;
    let fut = RequestSend::new(&sendable, &accesskey);
    let fut = fut.and_then(|sent_msg: Message| {
        info!("{:?}", sent_msg);
    let mut core = tokio_core::reactor::Core::new().unwrap();
    core.run(fut.map(|_| ()))


Currently the planned features only include to send SMS and query SMS stati.


  • serde impl for all relevant datatypes
  • roundtrip decode encode tests
  • use crate serde_plain for trait ToString and trait FromStr for objects which are used in query filters and payload www urlencode
  • future for SMS sending and retrieval based on hyper.rs
  • send SMS example using tokio as executor
  • future for listing SMS
  • listing SMS examples using tokio as executor
  • write documentation
  • future for notification callback on SMS reception
  • callback example using hyper (and thus imlicitly tokio) as executor
  • convert all service API return errors to typed errors
  • improve error information content
  • create sms callback notification test based on the receive example running on clever cloud (the creators of sozu)

MessageBird APIs

* = not planned, unless external contributors step up


MIT or Apache-2.0

If neither of those work for you, feel free to request so via a github issue.


Since I am not affiliated with MessageBird in any kind (other than being their customer) I'd be delighted if you'd leave a tipp to keep the automated send/receive routines going.



~435K SLoC