Install an API Client
Choose your preferred programming language to get started with the DocSpring API. To use the API from your terminal, scripts or CI jobs without writing code, install the DocSpring CLI.
Add the following line to your Gemfile:
gem "docspring"Then run:
bundle installConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the DocSpring client with no arguments:
client = DocSpring::Client.newOr pass credentials directly as arguments:
client = DocSpring::Client.new( api_token_id: 'API_TOKEN_ID', api_token_secret: 'API_TOKEN_SECRET')Install the package:
pip install --upgrade docspringConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsImport and initialize the DocSpring client:
from docspring import Clientclient = Client()Or provide credentials directly:
from docspring import Clientclient = Client(api_token_id='API_TOKEN_ID', api_token_secret='API_TOKEN_SECRET')Add docspring-ts to your package.json:
npm install docspring-ts --saveOr with Yarn:
yarn add docspring-tsConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the DocSpring client with no arguments:
import * as DocSpring from "docspring-ts";const apiInstance = new DocSpring.Client();Or provide credentials (and optionally a region or host) directly. A host (including DOCSPRING_HOST) is used before
a region:
import * as DocSpring from "docspring-ts";const apiInstance = new DocSpring.Client({ apiTokenId: "API_TOKEN_ID", apiTokenSecret: "API_TOKEN_SECRET", region: "EU",});Install via Composer:
composer require docspring/docspringOr add to your composer.json:
{ "require": { "docspring/docspring": "*" }}Then run:
composer installConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the client:
require 'vendor/autoload.php';
$config = DocSpring\Configuration::getDefaultConfiguration();$api = new DocSpring\Api\Client(null, $config);Or provide credentials directly:
require 'vendor/autoload.php';
$config = DocSpring\Configuration::getDefaultConfiguration();$config->setUsername('API_TOKEN_ID');$config->setPassword('API_TOKEN_SECRET');$api = new DocSpring\Api\Client(null, $config);Maven: add to your pom.xml dependencies:
<dependency> <groupId>com.docspring</groupId> <artifactId>DocSpring</artifactId> <version>4.4.0</version></dependency>Gradle: add to your build.gradle:
implementation 'com.docspring:DocSpring:4.4.0'Configure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the client with no arguments:
com.docspring.Client api = new com.docspring.Client();Or provide credentials directly:
com.docspring.Client api = new com.docspring.Client("API_TOKEN_ID", "API_TOKEN_SECRET");Pass a host or region too. A null host or region falls back to its environment variable, and a host (including
DOCSPRING_HOST) is used before a region:
com.docspring.Client api = new com.docspring.Client("API_TOKEN_ID", "API_TOKEN_SECRET", null, "EU");Install from NuGet:
Package Manager
PM> Install-Package DocSpring.Client.NET CLI
dotnet add package DocSpring.ClientPaket CLI
paket add DocSpring.ClientConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the client:
var api = DocSpring.Client.Client.EnvClientFactory.NewClient();Or provide credentials directly:
var api = DocSpring.Client.Client.EnvClientFactory.NewClient("API_TOKEN_ID", "API_TOKEN_SECRET");Install the package:
go get github.com/docspring/docspring-go/v4Configure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsImport and initialize the client:
import ( client "github.com/docspring/docspring-go/v4")
apiClient := client.NewClient("", "")Or provide credentials directly:
apiClient := client.NewClient("API_TOKEN_ID", "API_TOKEN_SECRET")Add to your mix.exs dependencies:
def deps do [ {:docspring, "~> 4.4.0"} ]endThen run:
mix deps.getConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the client connection and module:
conn = Docspring.Connection.new()api = Docspring.Api.ClientAdd the crate to your Cargo.toml, with Tokio to run its async methods and serde_json to build the data you send:
[dependencies]docspring = "4.5.0"serde_json = "1"tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Dates and times, such as the created_after filter, are chrono::DateTime values: add chrono = "0.4" if you pass
one.
Configure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsCreate the client. Its methods are the docspring::Api trait’s:
use docspring::Api;
let client = docspring::Client::from_env()?;Or provide credentials directly:
let client = docspring::Client::builder() .token_id("API_TOKEN_ID") .token_secret("API_TOKEN_SECRET") .build()?;Add docspring to your package.json:
npm install docspring --saveOr with Yarn:
yarn add docspringConfigure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deploymentsInitialize the DocSpring client with no arguments:
const DocSpring = require("docspring");const apiInstance = new DocSpring.Client();Or provide credentials directly:
const DocSpring = require("docspring");const apiInstance = new DocSpring.Client({ apiTokenId: "API_TOKEN_ID", apiTokenSecret: "API_TOKEN_SECRET",});If you would like DocSpring to support a new language, please send us an email at: [email protected]
We define our API endpoints and request/response schemas with an OpenAPI Specification (formerly known as Swagger). We use openapi-generator to automatically generate our API clients.