This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.mailfinch.com/:controller/:id(.:format) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://rdoc.info/projects/archiloque/rest-client | |
require 'rest_client' | |
########################################## | |
# Get all my letters | |
# curl -X GET http://localhost:3000/letters.xml?api_key=1b9884c66a | |
# curl -X GET http://localhost:3000/letters.json?api_key=1b9884c66a | |
RestClient.get 'http://localhost:3000/letters.xml?api_key=1b9884c66a' | |
########################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
<mailing-month>01</mailing-month> | |
<mailing-day>01</mailing-day> | |
<letter> | |
<pdf-remote-url>http://www.irs.gov/pub/irs-pdf/fw4.pdf</pdf-remote-url> | |
<sender-attributes> | |
<zip>20148</zip> | |
<city>Ashburn</city> | |
<street1>123 Any Street</street1> | |
<name>Some Dude</name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payload = Hash.new | |
# NOTE: Replace the text MY_API_KEY with the value of your personal API key | |
payload[:api_key] = MY_API_KEY | |
payload[:letter] = Hash.new | |
payload[:letter][:pdf] = File.new("/path/to/file") | |
payload[:letter][:sender_attributes] = { | |
:name => "Some Dude", | |
:street1 => "123 Any Street", | |
:city => "Ashburn", | |
:state => "VA", |