Skip to content

Instantly share code, notes, and snippets.

@mimeoconnect
Created September 9, 2011 06:30
Show Gist options
  • Save mimeoconnect/1205616 to your computer and use it in GitHub Desktop.
Save mimeoconnect/1205616 to your computer and use it in GitHub Desktop.
Doc APIs - Poster - Place Order (POST)
import urllib2
# Place Order
userid = "[your user id]"
userkey = "[your user key]"
size = "8.5x11"
paperstock = "Premium Photo"
lamination = "None"
mounting = "None"
pdfurl = "http://kinlane-productions.s3.amazonaws.com/pdf-samples/high-resolution-images/austrian-mountains-seen-in-the-distance.pdf"
companyname = "Mimeo"
fullname = "John Doe"
firstname = "John"
lastname = "Doe"
careof = "Jane Doe"
streetaddress = "123 There Street"
apartmentorsuite = "Suite 101"
state = "NY"
postalcode = "91101"
phone = "555-555-5555"
email = "info@dot.com"
isresidential = "True"
quantity = "5"
shippingchoice = "Ground"
paymentmethod = "Credit Card"
ccnumber = "4222333344445555"
ccname = "John Doe"
ccpostalcode = "91101"
cctype = "Visa"
ccexpirationmonth = "10"
ccexpirationyear = "2015"
format = "JSON"
environment = "Sandbox"
mimeouser = ""
mimeopass = ""
url = 'https://developer.mimeo.com/placeorder/'
params = urllib.urlencode({
'userid': userid,
'userkey': 'userkey',
'size': size,
'paperstock': paperstock,
'lamination': lamination,
'mounting': mounting,
'pdfurl': pdfurl,
'companyname': companyname,
'fullname': fullname,
'firstname': firstname,
'lastname': lastname,
'careof': careof,
'streetaddress': streetaddress,
'apartmentorsuite': apartmentorsuite,
'state': state,
'postalcode': postalcode,
'phone': phone,
'email': email,
'isresidential': isresidential,
'quantity': quantity,
'shippingchoice': shippingchoice,
'paymentmethod': paymentmethod,
'ccnumber': ccnumber,
'ccname': ccname,
'ccpostalcode': ccpostalcode,
'cctype': cctype,
'ccexpirationmonth': ccexpirationmonth,
'ccexpirationyear': ccexpirationyear,
'format': format,
'environment': environment,
'mimeouser': mimeouser,
'mimeopass': mimeopass
})
response = urllib2.urlopen(url, params).read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment