Here we have put together a hand full of python examples to help get you started. Please read through the official API Documentation to get a complete sense of what to expect from each endpoint. As always, feel free to contact us directly if you have any questions on implementation.
Before running these examples make sure you are in the examples/ directory.
cd examples/
An example showing how to dynamically create sample billing letters with merge variables using Lob's Letter API.
In order to run the program, enter:
cd create_letters_from_csv/
python letters.py input.csv
An example showing how to dynamically create postcards from a CSV using HTML, a custom font, merge variables, and Lob's Postcard API.
In order to run the program enter:
cd create_postcards_from_csv/
python create_postcards_from_csv.py input.csv
An example showing how to dynamically create checks from a CSV with merge variables using Lob's Check API.
In order to run the program enter:
cd create_check_from_csv/
python check.py input.csv
An example showing how to validate and cleanse a CSV spreadsheet full of shipping addresses using Lob's US Verification API.
Please note that if you are running this with a Test API Key, the verification API will always return a dummy address.
cd verify_addresses_from_csv/
python verify.py input.csv
python check.py
python letter.py
python postcard.py
python self_mailer.py
python create_card.py
python create_card_order.py