authy-rs

Crates.ioauthy-rs
lib.rsauthy-rs
version0.1.0
sourcesrc
created_at2018-12-06 22:40:20.554295
updated_at2018-12-06 22:40:20.554295
descriptionA API client for the Twilio Authy REST API.
homepage
repositoryhttps://github.com/jgraef/authy-rs
max_upload_size
id100468
size9,733
Janosch Gräf (jgraef)

documentation

README

authy-rs

Rust client for the Authy API by Twilio.

Disclaimer: This crate is not an official Twilio product.

Example

use twilio::authy::{Client, Via};
use phonenumber::PhoneNumber;

let client = Client::new("<AUTHY API KEY>");

let verify_response = client.verify("TEST PHONE NUMBER", Via::SMS, 6, "en").expect("verify failed");

let status_response = client.status(verify_response.uuid.into()).expect("status failed");
println!("Status:\n{:#?}", status_response);

// The verification code received as SMS
let code: u32 = 123456;
let check_response = client.check("TEST PHONE NUMBER", code).expect("check failed");
if check_response.success {
	println!("Phone number verified!");
}
else {
	println!("Verification failed");
}
Commit count: 18

cargo fmt