kintone

Crates.iokintone
lib.rskintone
version0.6.2
created_at2025-07-10 04:47:48.399728+00
updated_at2025-08-29 04:21:27.099933+00
descriptionkintone REST API client
homepagehttps://github.com/nojima/kintone-rs
repositoryhttps://github.com/nojima/kintone-rs
max_upload_size
id1745879
size400,408
Yusuke Nojima (nojima)

documentation

README

kintone-rs

Crates.io Documentation

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.

Quick Start

use kintone::client::{Auth, KintoneClient};

// Create a client
let client = KintoneClient::new(
    "https://your-domain.cybozu.com",
    Auth::api_token("your-api-token")
);

// Get a record
let response = kintone::v1::record::get_record(app_id, record_id)
    .send(&client)?;

// Print the record
for (field_code, field_value) in response.record.fields() {
    println!("{}: {:?}", field_code, field_value);
}

For detailed documentation, installation instructions, and usage examples, please refer to the API documentation.

Middleware Support

kintone-rs supports a middleware system for handling cross-cutting concerns like retries, logging, and authentication. Middleware layers can be easily composed to add functionality to your Kintone client.

Available Middleware

  • RetryLayer: Automatically retries failed requests with exponential backoff
  • LoggingLayer: Logs HTTP request and response information for debugging
  • BasicAuthLayer: Adds HTTP Basic authentication headers

Example: Retry

use std::time::Duration;
use kintone::client::{Auth, KintoneClientBuilder};
use kintone::middleware;

let client = KintoneClientBuilder::new(
        "https://your-domain.cybozu.com",
        Auth::api_token("your-api-token")
    )
    .layer(middleware::RetryLayer::new(
        5,                              // max_attempts
        Duration::from_millis(500),     // initial_delay
        Duration::from_secs(30),        // max_delay
        None                            // use default retry logic (retries any errors)
    ))
    .build();

Examples

You can find runnable examples in the examples directory.

The examples require environment variables to be set:

export KINTONE_BASE_URL=https://your-domain.cybozu.com
export KINTONE_API_TOKEN=your-api-token
cargo run --example get_record
Commit count: 198

cargo fmt