Skip to content

Instantly share code, notes, and snippets.

View joncalhoun's full-sized avatar
💻
Making Go Courses

Jon Calhoun joncalhoun

💻
Making Go Courses
View GitHub Profile
@joncalhoun
joncalhoun / output.json
Created October 29, 2012 13:17
EasyPost cURL Example Output
{
"address":{},
"error":"Address Not Found."
}
@joncalhoun
joncalhoun / output.json
Created October 29, 2012 12:56
EasyPost cURL Example Output
{
"address":{
"street1":"388 TOWNSEND ST",
"street2":"APT 20",
"city":"SAN FRANCISCO",
"state":"CA",
"zip":"94107"
}
}
@joncalhoun
joncalhoun / easypost-curl.sh
Created October 29, 2012 12:49
EasyPost cURL Example
curl https://www.easypost.co/api/address/verify \
-u cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi: \
-d 'address[street1]=388 Townsend St' \
-d 'address[city]=San Francisco' \
-d 'address[state]=CA' \
-d 'address[zip]=94107'
@joncalhoun
joncalhoun / easypost-curl.sh
Created October 29, 2012 12:48
EasyPost cURL Example
curl https://www.easypost.co/api/address/verify \
-u cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi: \
-d 'address[street1]=388 Townsend St' \
-d 'address[street2]=Apt 20' \
-d 'address[city]=San Francisco' \
-d 'address[state]=CA' \
-d 'address[zip]=94107'
@joncalhoun
joncalhoun / verify-output.json
Created October 29, 2012 12:43
Verify Address - Message output
{
"address":{
"street1":"388 TOWNSEND ST",
"city":"SAN FRANCISCO",
"state":"CA",
"zip":"94107"
},
"message":"Default address: The address you entered was found but more information is needed (such as an apartment, suite, or box number) to match to a specific address."
}
@joncalhoun
joncalhoun / easypost_python_examples.py
Created October 25, 2012 06:04
EasyPost Python Examples
import easypost
easypost.api_key = 'rWI791GTPCIwGMaQEGFQmJyEeZ925kln'
# Setting up data...
to_address = {
"street1": '388 Townsend St',
"street2": 'Apt 20',
"city": 'San Francisco',
"state": 'CA',
"zip": '94107'
@joncalhoun
joncalhoun / easypost_compare.java
Created October 1, 2012 10:28
Compare prices with EasyPost and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the package
EasyPost.Package package = new EasyPost.Package()
.setWeigth(1.1)
.setHeight(12)
.setWidth(14)
.setLength(7);
// Create the to and from addresses
@joncalhoun
joncalhoun / easypost_buy.java
Created October 1, 2012 10:26
Buy postage with Easy Post and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the package
EasyPost.Package package = new EasyPost.Package()
.setWeigth(1.1)
.setHeight(12)
.setWidth(14)
.setLength(7);
// Create the to and from addresses
@joncalhoun
joncalhoun / easypost_verify.java
Created October 1, 2012 10:35
Verify address with EasyPost and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the address to test
EasyPost.Address address = new EasyPost.Address()
.setName("Dirk Diggler")
.setStreet1("300 Granelli Ave")
.setCity("Half Moon Bay")
.setState("CA")
.setZip("94019");
@joncalhoun
joncalhoun / easypost_verify.py
Created October 1, 2012 09:52
Verify address with EasyPost and Python
import easypost
easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
easypost.Address.verify({
"street1": "101 California St",
"street2": "Suite 1290",
"city": "San Francisco",
"state": "CA",
"zip": "94111"
})