smartsheet-rs
smartsheet-rs is a rust crate which provides an async wrapper API that lets you easily interact
with the Smartsheet API 2.0.
This is an unofficial SDK I have made to learn Rust a little, but I hope you have fun with it -- I know that I certainly had quite a bit of fun in writing out the implementation for this crate.
Getting Started
Getting started with the smartsheet-rs library is easy:
-
Set SMARTSHEET_ACCESS_TOKEN in your environment; you can also use the
SmartsheetApi::from_tokenconstructor to explicitly set the token value. Find out more about Authentication and Access Tokens in the Smartsheet API Documentation. -
Add these dependencies to your
Cargo.toml:[] = "0.1" = { = "1", = ["rt-multi-thread", "macros"] } -
Add some usage to your application:
use SmartsheetApi; async
A Larger Example
When working with rows and cells in the SmartSheet API, one thing that stands out is that the API purposefully identifies columns by their ID, rather than their title or column name.
However, as humans it's much more natural and convenient to refer to column names
when working with the data.
Towards that end, the smartsheet-rs crate provides helper struct implementations
such as the ColumnMapper and CellGetter in order to simplify interaction
with the Smartsheet API.
Here's a quick example of how that would work:
use ;
// TODO update these values as needed
const SHEET_ID: u64 = 1234567890;
const COLUMN_NAME: &str = "My Column";
// A simple type alias so as to DRY.
type Result<T> = Result;
async
Implemented Methods
The following API methods from the official documentation have been implemented currently:
You can check out sample usage of these API methods in the examples/ folder in the project repo on GitHub.
Dependencies
This library uses only the minimum required dependencies, in order
to keep the overall size small. This crate uses hyper and hyper-tls
internally, to make HTTPS requests to the Smartsheet API.