Sha256: 7e0f9866b6190090eb6f8fb0f069ae338794631efbd6e657ecf05bf1f17a26a9

Contents?: true

Size: 1.95 KB

Versions: 37

Compression:

Stored size: 1.95 KB

Contents

.. module:: twilio.rest.resources

====================
Notifications
====================

For more information, see the `Notifications REST Resource
<http://www.twilio.com/docs/api/rest/notification>`_ documentation.


Listing Your Notifications
----------------------------

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

.. code-block:: ruby

    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 :attr:`log` and :attr:`message_date`.
The :attr:`log` value is 0 for `ERROR` and 1 for `WARNING`.

.. code-block:: ruby

    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
    :class:`Notification` instance resource representation.


Deleting Notifications
------------------------

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

.. code-block:: ruby

    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()

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
twilio-ruby-4.13.0 docs/usage/notifications.rst
twilio-ruby-4.12.1 docs/usage/notifications.rst
twilio-ruby-4.11.1 docs/usage/notifications.rst
twilio-ruby-4.11.0 docs/usage/notifications.rst
twilio-ruby-4.10.0.edge docs/usage/notifications.rst
twilio-ruby-4.10.0 docs/usage/notifications.rst
twilio-ruby-4.9.1 docs/usage/notifications.rst
twilio-ruby-4.9.1.edge docs/usage/notifications.rst
twilio-ruby-4.9.0 docs/usage/notifications.rst
twilio-ruby-4.9.0.edge docs/usage/notifications.rst
twilio-ruby-4.8.0 docs/usage/notifications.rst
twilio-ruby-4.7.0 docs/usage/notifications.rst
twilio-ruby-4.8.3.edge docs/usage/notifications.rst
twilio-ruby-4.8.2.edge docs/usage/notifications.rst
twilio-ruby-4.8.1.edge docs/usage/notifications.rst
twilio-ruby-4.8.0.edge docs/usage/notifications.rst
twilio-ruby-4.6.2 docs/usage/notifications.rst
twilio-ruby-4.6.1 docs/usage/notifications.rst
twilio-ruby-4.6.0 docs/usage/notifications.rst
twilio-ruby-4.7.0.edge docs/usage/notifications.rst