Hubspot API Rust Library
This unofficial Hubspot API Rust Library provides convenient access to the Hubspot CRM API from applications written in the Rust language.
Installation
To install the Hubspot API from crates.io, add the following line to your;
Cargo.toml
[]
= "0.1.0"
= "0.15" # Or preferred
Configuring your hubspot settings
This library utilises Hubspot Private App tokens to authenticate your requests. You can set up a Private App by following the instructions here: https://developers.hubspot.com/docs/api/private-apps
Initializing your Hubspot client
To set up your hubspot client you will need to add the following code.
.env
HUBSPOT_API_DOMAIN=api.hubapi.com
HUBSPOT_API_KEY=<Your-private-app-token-here>
HUBSPOT_PORTAL_ID=<Your-hubspot-portal-id-here>
main.rs
let hubspot = builder
.domain
.key
.portal_id
.build
.expect;
Usage
Below is an example of how to read a deal by ID.
example.rs
use Result;
use ;
// This is where you specify the deal properties that will be returned by hubspot
// This is where you specify which objects associations you want returned by hubspot
async
Contributions
At this stage we are not configured to accept contributions, please check back later. In the meantime please open an issue on github, and we will prioritise accordingly.
Local Development
Tool Set
Cargo
Install the rust tool chain in order to have cargo installed by following this guide.
Make
Install cargo-make using
cargo install cargo-make
Build
The project has been setup with several tasks in the Makefile.
To run these tasks execute command
cargo make taskname, where taskname is the name of task available
in the Makefile.toml
Running cargo make ci command runs the tasks to
format the files, check for lint errors, clean, build(in offline mode) and run tests.