| Crates.io | dingtalk-sdk |
| lib.rs | dingtalk-sdk |
| version | 1.0.3 |
| created_at | 2024-09-10 15:00:12.223157+00 |
| updated_at | 2025-03-02 16:20:47.733785+00 |
| description | Dingtalk SDK for Rust. |
| homepage | https://github.com/lvillis/dingtalk-sdk-rust |
| repository | https://github.com/lvillis/dingtalk-sdk-rust |
| max_upload_size | |
| id | 1370475 |
| size | 59,784 |
dingtalk-sdk-rustDingtalk SDK for Rust.
This project is a DingTalk API SDK written in Rust, providing convenient tools for sending messages via DingTalk robots (Webhook and Enterprise Bots). It leverages asynchronous programming using Tokio, offering straightforward and efficient interaction with DingTalk services.
Add the following to your Cargo.toml:
[dependencies]
dingtalk-sdk = "1"
use dingtalk_sdk::DingTalkRobot;
#[tokio::main]
async fn main() {
let robot = DingTalkRobot::new("your_token".into(), Some("your_secret".into()));
match robot.send_text_message("Hello from Rust!", None, None, Some(false)).await {
Ok(response) => println!("Sent successfully: {}", response),
Err(e) => eprintln!("Error sending message: {}", e),
}
}
use dingtalk_sdk::EnterpriseDingTalkRobot;
#[tokio::main]
async fn main() {
let robot = EnterpriseDingTalkRobot::new("appkey".into(), "appsecret".into(), "robot_code".into());
match robot.send_group_message("open_conversation_id", "Greetings", "Hello group from Rust!").await {
Ok(response) => println!("Message sent: {}", response),
Err(e) => eprintln!("Error sending message: {}", e),
}
}
This project is licensed under the MIT License.