Ruby: Get The Status Of A Letter with GetLetterStatus()

The following code will retrieve status 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 with two members: the delivery status code (as defined here) and the last datetime in which the letter was updated.
    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 =
delivery_status, last_update = client.get_letter_status(LetterID)