Notifications

For more information, see the Notifications REST Resource documentation.

Listing Your Notifications

The following code will print out additional information about each of your current Notification resources.

require 'twilio-ruby'

# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"

@client = Twilio::REST::Client.new account_sid, auth_token

@client.notifications.list.each do |notification|
  puts notification.more_info
end

You can filter transcriptions by log and message_date. The log value is 0 for ERROR and 1 for WARNING.

require 'twilio-ruby'

# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"

@client = Twilio::REST::Client.new account_sid, auth_token

ERROR = 0

@client.notifications.list(log=ERROR).each do |notification|
  puts notification.error_code
end

Note

Due to the potentially voluminous amount of data in a notification, the full HTTP request and response data is only returned in the Notification instance resource representation.

Deleting Notifications

Your account can sometimes generate an inordinate amount of Notification resources. The Notifications resource allows you to delete unnecessary notifications.

require 'twilio-ruby'

# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"

@client = Twilio::REST::Client.new account_sid, auth_token
@client.notifications.get("NO123").delete()