Ruby: Get The Status Of Multiple Letters with GetLetterStatusMultiple()
The following code will retrieve status information regarding multiple letters in your queue:
- Replace MyUsername and MyPassword with your PostalMethods user details.
- Replace LetterID1, LetterID2, etc. with the unique IDs returned when sending these letter.
- Execute this code. If the returned ResultCode equals -3000, this call will return an array of statuses (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 = PostalMethods::Client.new(options) client.prepare! statuses = client.get_letter_status_multiple([LetterID1, LetterID2, LetterIDn])

