SWS GetCertifiedLetterInfo Method
Retrieves certified letter tracking information for a specified letter. This includes the letter ID, date, name, binary .pdf data and USPS tracking number (BARCODE).
Parameters
Name | DataType | Is Required |
---|---|---|
AcctID | Long | Required |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
LetterID | Long | Required |
Description | The certified letter’s ID number. This can be found using the GetLetterInfo method. |
Returned Parameters
Name | DataType |
---|---|
BARCODE | String |
Description | The barcode number affixed to the certified letter by the USPS for tracking purposes. |
EFILE_PDF | Base64Binary |
Description | The eFile .pdf in encrypted Base64Binary code. This is the .PDF information sent to our centralized mailing company. |
EVENT_NAME | String |
Description | The template name of the certified letter to be mailed. |
EVENTDATE | String |
Description | The schedule date by which the certified letter should be mailed. |
LETTER_ID | Long |
Description | The certified letter’s ID number. |
SIGNPDF | Boolean |
Description | Indicates if the certified mail will require a signature (“True”) or not (“False”). |
ERROR_CODE | Integer |
Description | The numerical value of the status of the letter. |
ERROR_REASON | String |
Description | The textual value of the status of the letter. |
Example
As with every method we need to pass in credentials. We do this with the LookupUser request object.
We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project. We’ll need the standard service object, GetCertifiedLetterInfo request object, and a GetCertifiedLetterInfo response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetCertifiedLetterInfo_Request request = new SWS.GetCertifiedLetterInfo_Request();
SWS.GetCertifiedLetterInfo_Response response;
Here’s my sample code of the Request object.
// GetCertifiedLetterInfo Request
request.AccountID = 123456;
request.LetterID = 123456;
Finally we can call the method and pass across the login object and the request object to perform our method. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the response object
try
{
response = service.GetCertifiedLetterInfo(user_request,request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.
For a full list of methods see SWS Methods.
-
September 13, 2012 at 11:54 amSWS Methods Table of Contents « Centershift Developer eXchange