Introduction

try{paper} provides an API that will print and mail documents for you. You can add mailings using our API by providing the return address, recipient address, and the contents (stuff we'll print) for the mailing. Once you've sent us the mailing, we'll automatically batch any additional mailings over the next 24 hours. At the end of that period we'll begin the process of:

  • Download/Convert anything you sent us that wasn't a PDF
  • Scrubs addresses (Zip+4 lookup, and other fixes)
  • Build address wrapper pages so you don't have to format your document to line up in the envelope windows
  • Print, package and mail your documents

# All this code is just for demonstration purposes
React.api_key = "In here goes your api key!"# All this code is just for demonstration purposes
react.api_key = "In here goes your api key!"# All this code is just for demonstration purposes
React::setApiKey("In here goes your api key!");

Authorization & Security

In order to use the API you'll need an API key. Your API key can be found on your account dashboard by clicking the eye icon to make it visible ( ). This key will always start with the letters 'TP'.

This key should be kept private. Only persons you want sending mailings on your behalf should have access to this key. If you feel it's been compromised, you can generate a new one at any time and the old key will become invalid immediately.

TryPaper uses basic HTTP authentication, simply append the 'Authorization' header to each of your requests with your API key. If you're using one of our pre-built client libraries, we'll do this automatically for you.

Additionally, ALL requests must be made using HTTPS. Requests to non HTTPS endpoints will result in a perminant redirect (HTTP 301) to the HTTPS endpoint.

class A < B 
	def self.create(object = User) 
		return object 
	end
	def full_name
		return "#{self.first_name} #{self.last_name}"
	end
end
class Mapping:
	def __init__(self, iterable):
		self.items_list = []
		self.__update(iterable)
	def update(self, iterable):
		for item in iterable:
			self.items_list.append(item)
class myClass {
	var $input;
	var $output;
	function myClass($input) {
		$output = 'You entered: ' . $input;
		return $output;
	}
}

Data Serialization

TryPaper supports both JSON and XML seralization though we prefer JSON due to reduced verbosity. This can be controlled with the HTTP headers of 'Accept' and 'Content-Type'. JSON should be presented as 'application/json' and XML as 'text/xml'.

React::Game.create(
  :name => "Super Mario Bros",
  :company => "Nintendo",
  :some_key => "yey_JA390094AWPIWWN435",
  :rating => 100
)
react.Game.create(
  name="Super Mario Bros",
  company="Nintendo",
  some_key="yey_JA390094AWPIWWN435"
  rating=100
)
React_Charge::create(array(
  "name" => "Super Mario Bros",
  "company" => "Nintendo",
  "some_key" => "yey_JA390094AWPIWWN435"
  "rating" => 100
));

# Object Response
{
  "object": "Game",
  "name": "Super Mario Bros",
  "company": "Nintendo",
  "some_key": "yey_JA390094AWPIWWN435",
  "rating": 100
  "description": {
    "some_desc1": null,
    "some_desc2": null,
    "some_desc3": null,
    "some_desc4": null,
  }
  "valid": true,
  "other_field": null
}	

Users

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

The User Object

name:
string The name of the user
email:
string The email of the user
country:
string 2 letter code for the country
age:
integer Age of the user
description:
hash key/value pairs with fields that describe the user.
React::User.create(
  :name => "John McClane",
  :email => "john_mcclane@awesome.com",
  :country => "US",
  :some_key => "yey_JA390094AWPIWWN435",
  :age => 53
)
react.User.create(
  name="John McClane",
  email="john_mcclane@awesome.com",
  country="US",
  some_key="yey_JA390094AWPIWWN435",
  age=53
)
React_User::create(array(
  "name" => "John McClane",
  "email" => "john_mcclane@awesome.com",
  "country" => "US",
  "some_key" => "yey_JA390094AWPIWWN435",
  "age" => 53
));

# Object Response
{
  "object": "User",
  "name": "John McClane",
  "email": "john_mcclane@awesome.com",
  "country": "US",
  "some_key": "yey_JA390094AWPIWWN435",
  "age": 53
  "address": {
    "address_line1": null,
    "address_line2": null,
    "address_city": null,
    "address_state": null,
    "address_zip": null,
    "address_country": null
  }
  "valid": true,
  "description": null
}

Orders

It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

React::Order.create(
  :item => "React Bootstrap Theme",
  :price => 1500,
  :name => "John McClane",
  :email => "john_mcclane@awesome.com",
  :country => "US",
  :some_key => "yey_JA390094AWPIWWN435",
  :age => 53
)
react.User.create(
  item="React Bootstrap Theme",
  price=1500,
  name="John McClane",
  email="john_mcclane@awesome.com",
  country="US",
  some_key="yey_JA390094AWPIWWN435",
  age=53
)
React_User::create(array(
  "item" => "React Bootstrap Theme",
  "price" => 1500,
  "name" => "John McClane",
  "email" => "john_mcclane@awesome.com",
  "country" => "US",
  "some_key" => "yey_JA390094AWPIWWN435",
  "age" => 53
));

# Object Response
{
  "object": "Order",
  "item": "React Bootstrap Theme",
  "price": 1500,
  "name": "John McClane",
  "email": "john_mcclane@awesome.com",
  "country": "US",
  "some_key": "yey_JA390094AWPIWWN435",
  "age": 53
  "address": {
    "address_line1": null,
    "address_line2": null,
    "address_city": null,
    "address_state": null,
    "address_zip": null,
    "address_country": null
  }
  "valid": true,
  "description": null
}

Errors

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

Attributes

code:
string Code of the error
message:
string A complete message with details about the error to show users.
200 OK - Everything worked.
400 Bad Request - The request was badly built
401 Unauthorized - Some other message
402 Request Failed - The request failed
404 Not Found - Doesn't exist
500, 502, 503, 504 Server errors