Expand description

A fully generated, opinionated API client library for KittyCAD.

docs.rs

API Details

API server for KittyCAD

Contact

urlemail
https://kittycad.ioapi@kittycad.io

Client Details

This client is generated from the KittyCAD OpenAPI specs based on API spec version 0.1.0. This way it will remain up to date as features are added. The documentation for the crate is generated along with the code to make this library easy to use.

To install the library, add the following to your Cargo.toml file.

[dependencies]
kittycad = "0.1.4"

Basic example

Typical use will require intializing a Client. This requires a user agent string and set of credentials.

use kittycad::Client;

let kittycad = Client::new(
    String::from("api-key"),
);

Alternatively, the library can search for most of the variables required for the client in the environment:

  • KITTYCAD_API_TOKEN

And then you can create a client from the environment.

use kittycad::Client;

let kittycad = Client::new_from_env();

Modules

API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.

API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.

CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.

Hidden API endpoints that should not show up in the docs.

Meta information about the API.

Endpoints that implement OAuth 2.0 grant flows.

Operations around payments and billing.

Sessions allow users to call the API from their session cookie in the browser.

The data types sent to and returned from the API client.

Unit conversion operations.

A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves.

Structs

Entrypoint for interacting with the API client.