SendLetterAdvanced - New Feature

Description

The SendLetterAdvanced() method is the simplest way to send a letter with reply envelope and perforation through the PostalMethods service.

With this method, you must create a letter which includes the address block in its proper location for the envelope type you wish to use Letter templates are available and provide a reply address in case you wish to add reply envelope to your request for the various envelope types that PostalMethods support.

Formal Definition

https://api.postalmethods.com/2009-09-09/PostalWS.asmx?op=SendLetterAdvanced

Input

Property Type Comments
APIKey String Can be generated in the Control Panel
MyDescription String Up to 100 characters.
Free text. User may add any text to help identify the request (UTF8)
FileExtension String Provide details regarding the files and templates used for this letter - either new or pre-uploaded.
See the appendix at the bottom of this page
FileBinaryData base64Binary Attached document represented as binary data
List of supported file types
AttentionLine1 String Up to 45 characters.
Non-address data, such as company, name, position, department, etc.
Line will not be printed when empty.

At least one of the attention or company lines must contain data.

AttentionLine2 String Up to 45 characters.
Non-address data, such as name, position, department, etc.
Line will not be printed when empty
Company String Up to 45 characters.
Company / Firm name.

At least one of the attention or company lines must contain data.

Address1 String Up to 45 characters.Main delivery address (e.g., 123 Main St.) or PO Box.
This line must contain data.
Address2 String Up to 45 characters.
Secondary address unit (i.e., Additional address elements such as Apartment, Suite, Building, Room, etc.)
City String Up to 30 characters.
Use 'FPO' or 'APO' when sending to U.S. Military destinations.
This line must contain data.
State String Up to 30 characters.
State or Region.
Use 'AE', 'AP' or 'AA' when sending to U.S. Military destinations
ZipCode String Up to 15 characters.
Provide postal code in a format used in the destination country. When destination country is the USA, use a ZIP+4 code. If ZIP+4 is not provided we will try to add it
Country String Up to 45 characters.
Value is required only when destination country is different than the user's country.
Perforation BottomThird Indicates whether the perforation include in the request or not.
ReplyEnvelope Env9ReplySingleWindow Indicates whether the reply envelope include in the request.
WorkMode Default or Production or Development Indicates whether the letter should be processed completely ('Production') or only simulated as a test ('Development'). 'Default' will use the PostalMethods User's default Work Mode setting

Output: SendLetterAdvancedsResponse

Element Type Comments
SendLetterAdvancedResult int In case of successful submission, a positive number is returned indicating the letter's unique identifier on the system.
In case of failure, a negative number is returned indicating the failure reason. See the list of Web Service Result Codes.




File Extension

Allowed Content:

  1. Upload a document per request: The extension of the attached document.
    • Example: pdf (see list of supported file types)
    • FileBinaryData must contain the binary representation of the document.
  2. Refer to pre-uploaded files: The name(s) of a pre-uploaded document(s) according to order (semicolon as delimiter).
    • Format: MyFile:<finename1>.<extension1>;MyFile:<finename2>.<extension2>;...
    • Example: MyFile:File1.pdf;MyFile:File2.docx;...
    • FileBinaryData must be empty.
  3. Using a template and merge data: the name of a pre-uploaded template.
    • Format: MyTemplate:<filename>.<extension>
    • FileBinaryData may either be empty or contain a binary representation of values to be merged to this template in an XML format.
    • Optional: you may specify additional pre-uploaded files to be added to the letter. Example: MyTemplate:File1.html;MyFile:File2.pdf;...

Read this article for additional details.