kintone-rs
DISCLAIMER: this OSS is my own personal work and does not have any relationship with Cybozu Inc. or any other organization which I belong to.
WARNING: This library is under development and is likely to undergo incompatible changes in the future.
A client library of Kintone REST APIs for Rust.
See examples in the examples directory.
Install
Add following line in your Cargo.toml right below [dependencies].
= { = "https://github.com/nojima/kintone-rs" }
Usage
This library provides a fluent API for interacting with Kintone REST APIs using method chaining. All API functions return request builders that can be configured with additional parameters and then sent to the Kintone server.
Basic Example
Here's a simple example that retrieves a record from a Kintone app and displays it:
use Error;
use ;
APIs
The library currently supports the following Kintone REST APIs:
kintone::v1::record:get_record,get_records,add_record,update_record,update_assignees,update_status,get_comments,add_comment,delete_comment
kintone::v1::file:upload,download
kintone::v1::thread:add_thread_comment
Each function follows the same pattern: create a request builder, optionally configure it with additional parameters, and then call .send(&client) to execute the request.
let response = get_records // `get_records` returns a request builder
.query // `query` is optional argument
.fields // `fields` is also optional argument
.send // send the request to the server
With this pattern, we can add optional arguments to the our API without breaking backward compatibility.
For more detailed examples and usage patterns, check out the examples directory in this repository. Each example demonstrates how to use specific API endpoints and can be run directly to test the functionality.
Note: If you forget to call .send(&client), don't worry! The compiler will remind you with a helpful warning like:
unused `kintone::v1::space::AddThreadCommentRequest` that must be used
This happens because request builders are marked with #[must_use], so you'll quickly notice if you accidentally create a request without sending it.
More Examples
You can find examples in the ./examples directory.
These examples takes some parameters from environment variables:
KINTONE_BASE_URL: Your Kintone domain URL (e.g.,https://your-domain.cybozu.com)KINTONE_API_TOKEN: Your API token for authenticationKINTONE_USERNAME: Your user name for KintoneKINTONE_PASSWORD: Your password for Kintone
You can run examples like this: