Home > API General, Letters > SWS GetLetterInfo Method

SWS GetLetterInfo Method


Retrieves a collection of correspondence data for a specified account or rental. If you want all the letters on the account for all rentals use the AccountID. If you are looking for just a specific rental’s letters use the RentalID.

Parameters

Name DataType Is Required
AccountID Long Optional*
Description The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method.
*Either the AccountID or RentalID is required.
RentalID Long Optional*
Description The rental’s  ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
*Either the AccountID or RentalID is required.

Returned Parameters

Name DataType
ACCT_ID Long
Description The account’s ID number.
ACTIVE String
Description “Y” if the letter is currently active, “N” if it is not.
ADR_TYPE String
Description The address type information.
Available values:

  • Home
  • Office
  • Mailing
  • Shipping/Delivery
  • Other
CERTIFIED Boolean
Description “True” if the letter is to be sent as certified mail, “False” if not.
CNAME String
Description The first, last and known as names of the primary contact.
CONTACT_ID Long
Description The rental contact’s ID number.
CREATED_BY Long
Description The ID for the user that created the letter.
CREATED_NAME String
Description The name of the person that created the document.
EMAIL Boolean
Description “True” if the letter was sent by email, “False” if not.
EMAIL_TO String
Description The contact’s email address.
EMAIL_STS String
Description Indicates whether the email was sent successfully.
EXPORT_ID Long
Description The batch ID number in which the letter was sent.
GEN_TYPE String
Description Whether the letter was manually generated or automatically generated by the system.
LETTER_ID Long
Description The letter’s ID.
LTR_NAME String
Description The the letter’s name.
LTR_NUM Long
Description The specified full letter ID.
LTR_TYPE String
Description The textual value of the type of letter. (I.E., Invoice)
LTR_TYPE_ID Long
Description The ID of a specific letter. (I.E., LTR_TYPE_ID = 1000, The letter type is an invoice, but 1000 refers to the Store Generic Invoice letter.)
LTR_TYPE_VAL Integer
Description The numeric value of the type of letter. (I.E., 1 = Invoice Type)
MAIL_LOCAL String
Description Whether the mailing was handled through the site or through centralized mail.
MAILED DateTime
Description The date the letter was mailed.
RENTAL_ID Long
Description The rental item’s ID number.
SCHEDULED DateTime
Description The scheduled date the letter is to be sent if different then MAILED.
SENT String
Description Whether the mailing was handled through the site or through centralized mail.
STATUS Boolean
Description Indicates the status of the registered mail letter.
STATUS_VAL String
Description The current delinquency status of the account.
STS_MEANING String
Description The textual meaning of the EMAIL_STS.
UNIT_NUM String
Description The unit’s number as assigned by the organization. This is not the UnitID.
UNIT_NUM_STS String
Description The display name from the search function this includes the unit number and if the account is delinquent or not.
VERSION Integer
Description The version number of the letter if there have been updates.
EMAIL_SENT DateTime
Description The date the email was sent.
PROCESSED_FLAG String
Description Indicates if the letter was processed through centralized processing.
EMAIL_ONLY Boolean
Description Whether the letter is to only be emailed and not sent regular mail.
BARCODE Decimal
Description The barcode number for registered mail.
EMAIL_REG_TYPE Decimal
Description Indicates if the email was sent registered and if so what level of regeistration was used.

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.  At this point we need to our objects.  We’ll need the standard service object, a GetLetterInfo request object and a GetLetterInfo response object.  We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetLetterInfo_Request request = new SWS.GetLetterInfo_Request();
SWS.GetLetterInfo_Response response;

Here’s my sample code of the Request object using the account ID, alternately you can use the rental ID.

// GetLetterInfo Request
request.AccountID = 123456;

Finally we can call the method and pass across the login object and the request object to get our letter info. 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.GetLetterInfo(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.

Categories: API General, Letters Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s