Last active
August 29, 2015 14:07
-
-
Save pepijn/1fc1b639d10d2d29becd to your computer and use it in GitHub Desktop.
StuurPerPost API examples
This file contains hidden or 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
ENVELOPES(1) StuurPerPost.nl API Manual ENVELOPES(1) | |
NAME | |
POST /v1/envelopes -- Send a PDF file to an address in The Netherlands |
This file contains hidden or 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
curl https://api.stuurperpost.nl/v1/envelopes \ | |
--request POST \ | |
--form "[email protected]" \ | |
--form "address[]=Burgemeester en Wethouders van Amsterdam" \ | |
--form "address[]=t.a.v. de Bezwaarschriftencommissie Wegslepen" \ | |
--form "address[]=Postbus 551" \ | |
--form "address[]=1000 AN Amsterdam" \ | |
--form letter=@/path/to/document.pdf |
This file contains hidden or 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
require 'rest-client' | |
API_ENDPOINT = 'https://api.stuurperpost.nl/v1/envelopes' | |
address = [ | |
"Burgemeester en Wethouders van Amsterdam", | |
"t.a.v. de Bezwaarschriftencommissie Wegslepen", | |
"Postbus 551", | |
"1000 AN Amsterdam" | |
] | |
letter = open '/path/to/document.pdf' | |
response = RestClient.post API_ENDPOINT, address: address, letter: letter | |
puts response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment