Skip to content

Install an API Client

Choose your preferred programming language to get started with the DocSpring API.

Add the following line to your Gemfile:

gem "docspring"

Then run:

Terminal window
bundle install

Configure authentication via environment variables:

Terminal window
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"
export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"

You can also configure the region or host:

Terminal window
export DOCSPRING_REGION="US" # US or EU (defaults to US)
export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deployments

Initialize the DocSpring client with no arguments:

client = DocSpring::Client.new

Or pass credentials directly as arguments:

client = DocSpring::Client.new(
api_token_id: 'API_TOKEN_ID',
api_token_secret: 'API_TOKEN_SECRET'
)