Ruby: Get Letter Metadata with GetLetterDetails()

The following code retrieves detailed information regarding a letter in your queue:

  1. Replace MyUsername and MyPassword with your PostalMethods user details.
  2. Replace LetterID with the unique ID returned when sending this letter.
  3. Execute this code. If the returned ResultCode equals -3000, this call will return an array of details (as defined here).
    If the returned ResultCode is different than -3000, the request was unsuccessful. Check the Web Service Status Codes section.
#!/usr/bin/env ruby 
require 'rubygems'
require 'postalmethods'
options = {:username => 'MyUsername', :password => 'MyPassword'}
client =
statuses = client.get_letter_details(LetterID)