zoho_crm/
lib.rs

1//! # zoho-crm
2//!
3//! Library to help interact with v2 of the Zoho CRM API.
4//!
5//! You can read more information about the Zoho API here:
6//! [https://www.zoho.com/crm/developer/docs/api/oauth-overview.html](https://www.zoho.com/crm/developer/docs/api/oauth-overview.html)
7//!
8//! To handle parsing response records, you will also need deserializable objects with `serde`:
9//!
10//! ```toml
11//! [dependencies]
12//! serde = { version = "1.0", features = ["derive"] }
13//! ```
14//!
15//! ### Example
16//!
17//! ```no_run
18//! use serde::Deserialize;
19//! use zoho_crm::Client;
20//!
21//! let client_id = String::from("YOUR_CLIENT_ID");
22//! let client_secret = String::from("YOUR_CLIENT_SECRET");
23//! let refresh_token = String::from("YOUR_REFRESH_TOKEN");
24//!
25//! let mut client = Client::with_creds(
26//!     None, // access token
27//!     None, // api domain
28//!     client_id,
29//!     client_secret,
30//!     refresh_token
31//! );
32//!
33//! #[derive(Debug, Deserialize)]
34//! struct Account {
35//!     id: String,
36//!     name: String,
37//! }
38//!
39//! let account = client.get::<Account>("Accounts", "ZOHO_ID_HERE").unwrap();
40//! ```
41
42extern crate reqwest;
43extern crate serde;
44extern crate serde_json;
45extern crate serde_urlencoded;
46
47mod client_error;
48mod client;
49pub mod response;
50mod token_record;
51
52pub use client::Client;
53pub use client::parse_params;
54pub use client_error::ClientError;
55pub use token_record::TokenRecord;