Lob Help Center

SDKs & tools

Table of Contents

Postman

Postman is a great way for developers to get started on using Lob’s APIs. Our public workspace allows you and your team to collaborate and make sure you have everything you need to get familiar with Lob’s APIs.

Explore Lob's APIs with Postman:

SDKs

Currently, we have SDKs available for the following languages:

TypeScript

Installation

Lob's TypeScript SDK can be installed through NPM:
$ npm i @lob/lob-typescript-sdk

To build and install from the latest source:
$ git clone git@github.com:lob/lob-typescript-sdk.git

$ npm install


Learn more at the lob-typescript-sdk repository on GitHub.

Delete

PHP

Installation

The recommended way to install lob-php is through Composer.

Install Composer

curl -sS https://getcomposer.org/installer | php

Add Lob.com PHP client as a dependency

composer require lob/lob-php

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Learn more at the lob-php repository on GitHub.

Delete

Java

Installation

Include the following in your pom.xml for Maven:

<dependencies> 
  <dependency> 
    <groupId>com.lob</groupId> 
    <artifactId>lob-java</artifactId> 
    <version>12.3.7</version> 
  </dependency> 
  ... 
</dependencies>


Gradle:
compile 'com.lob:lob-java:12.3.7'

Learn more at the lob-java repository on GitHub.

Delete

Python

Installation

You can use pip to install the package:

pip install lob

To initialize the wrapper, import lob and set the api_key:

import lob 

lob.api_key = 'your-api-key'


Learn more at the lob-python repository on GitHub.

Delete

Ruby

Installation

Add this line to your application's Gemfile:
gem 'lob'

And then execute:

$ bundle

Or manually install it yourself:

$ gem install lob

Learn more at the lob-ruby repository on GitHub.

Delete

Elixir

Installation

The package can be installed by adding :lob_elixir to your list of dependencies in mix.exs:

 def deps do
   [
     {:lob_elixir, "~> 1.5.0"}
   ]
 end


Learn more at the lob-elixir repository on GitHub.

Delete

Don’t see your favorite language?

Let us know which language you’d like us to support next.  Drop us an email.

Libraries

Address Elements

Address Elements works by targeting the input elements of your address form and using their values with Lob's verification and autocomplete functionality.

JavaScript

Registration

Create an account at Lob.com to obtain a Live Public API Key. The key is available in the Lob settings panel and uses the format, live_pub_*.

Usage

Embed the Lob Address Elements script immediately before the closing tag in the html containing your address form. The script will autodetect your form and its inputs.

<script src="https://cdn.lob.com/lob/address-elements/2.2.1/address-elements.min.js" data-lob-key="live_pub_xxx">

Learn more at the address-elements repository on GitHub.

Delete

React

This is a very lightweight component that uses the Lob Autocomplete API in order to simplify the process of adding in a search autocomplete bar or form. Check out the Autocomplete API for more configuration options in Lob documentation.

Installation

npm install --save @lob/react-address-autocomplete

Learn more at the react-address-autocomplete NPM repository.

Delete

Tools

cURL

Usage

cURL is used in command lines or scripts to transfer data. We've included cURL code snippets in our documentation for each resource. By including your API key, you can run these commands from the terminal and see the response from Lob's API.

curl https://api.lob.com/v1/addresses \
-u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:

Explore Lob's documentation for more cURL examples.

Delete

OpenAPI

Usage

We've written an OpenAPI v3 authored specification for the current Lob API. This provides users the ability to generate SDKs in languages not currently supported by Lob, import Lob operations and schemas into popular tools that support OpenAPI or define operations and schemas in middleware solutions.

Learn more at the lob-openapi repository on GitHub.

Delete

Insomnia

Usage

Insomnia REST client is a free cross-platform desktop framework for testing RESTful applications. We've created a collection for Lob's API endpoint for use with Insomnia.

Run in Insomnia}

Learn more in lob-insomnia repository on GitHub.

Delete

Get Started

Visit our Quickstart guide to create your first postcard with Lob’s Print & Mail API.

Was this article helpful?