twilio.rest.api.v2010.account.message package

Submodules

twilio.rest.api.v2010.account.message.feedback module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.api.v2010.account.message.feedback.FeedbackInstance(version, payload, account_sid, message_sid)[source]

Bases: twilio.base.instance_resource.InstanceResource

class Outcome[source]

Bases: object

CONFIRMED = 'confirmed'
UNCONFIRMED = 'unconfirmed'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
date_created
Returns:The RFC 2822 date and time in GMT that the resource was created
Return type:datetime
date_updated
Returns:The RFC 2822 date and time in GMT that the resource was last updated
Return type:datetime
message_sid
Returns:The SID of the Message resource for which the feedback was provided
Return type:unicode
outcome
Returns:Whether the feedback has arrived
Return type:FeedbackInstance.Outcome
uri
Returns:The URI of the resource, relative to https://api.twilio.com
Return type:unicode
class twilio.rest.api.v2010.account.message.feedback.FeedbackList(version, account_sid, message_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(outcome=<object object>)[source]

Create the FeedbackInstance

Parameters:outcome (FeedbackInstance.Outcome) – Whether the feedback has arrived
Returns:The created FeedbackInstance
Return type:twilio.rest.api.v2010.account.message.feedback.FeedbackInstance
class twilio.rest.api.v2010.account.message.feedback.FeedbackPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of FeedbackInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.api.v2010.account.message.feedback.FeedbackInstance
Return type:twilio.rest.api.v2010.account.message.feedback.FeedbackInstance

twilio.rest.api.v2010.account.message.media module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.api.v2010.account.message.media.MediaContext(version, account_sid, message_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the MediaInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MediaInstance

Returns:The fetched MediaInstance
Return type:twilio.rest.api.v2010.account.message.media.MediaInstance
class twilio.rest.api.v2010.account.message.media.MediaInstance(version, payload, account_sid, message_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

account_sid
Returns:The SID of the Account that created this resource
Return type:unicode
content_type
Returns:The default mime-type of the media
Return type:unicode
date_created
Returns:The RFC 2822 date and time in GMT that this resource was created
Return type:datetime
date_updated
Returns:The RFC 2822 date and time in GMT that this resource was last updated
Return type:datetime
delete()[source]

Deletes the MediaInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MediaInstance

Returns:The fetched MediaInstance
Return type:twilio.rest.api.v2010.account.message.media.MediaInstance
parent_sid
Returns:The SID of the resource that created the media
Return type:unicode
sid
Returns:The unique string that identifies this resource
Return type:unicode
uri
Returns:The URI of this resource, relative to https://api.twilio.com
Return type:unicode
class twilio.rest.api.v2010.account.message.media.MediaList(version, account_sid, message_sid)[source]

Bases: twilio.base.list_resource.ListResource

get(sid)[source]

Constructs a MediaContext

Parameters:sid – The unique string that identifies this resource
Returns:twilio.rest.api.v2010.account.message.media.MediaContext
Return type:twilio.rest.api.v2010.account.message.media.MediaContext
get_page(target_url)[source]

Retrieve a specific page of MediaInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of MediaInstance
Return type:twilio.rest.api.v2010.account.message.media.MediaPage
list(date_created_before=<object object>, date_created=<object object>, date_created_after=<object object>, limit=None, page_size=None)[source]

Lists MediaInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • date_created_before (datetime) – Only include media that was created on this date
  • date_created (datetime) – Only include media that was created on this date
  • date_created_after (datetime) – Only include media that was created on this date
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, list() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
Returns:

Generator that will yield up to limit results

Return type:

list[twilio.rest.api.v2010.account.message.media.MediaInstance]

page(date_created_before=<object object>, date_created=<object object>, date_created_after=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of MediaInstance records from the API. Request is executed immediately

Parameters:
  • date_created_before (datetime) – Only include media that was created on this date
  • date_created (datetime) – Only include media that was created on this date
  • date_created_after (datetime) – Only include media that was created on this date
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of MediaInstance

Return type:

twilio.rest.api.v2010.account.message.media.MediaPage

stream(date_created_before=<object object>, date_created=<object object>, date_created_after=<object object>, limit=None, page_size=None)[source]

Streams MediaInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient.

Parameters:
  • date_created_before (datetime) – Only include media that was created on this date
  • date_created (datetime) – Only include media that was created on this date
  • date_created_after (datetime) – Only include media that was created on this date
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
Returns:

Generator that will yield up to limit results

Return type:

list[twilio.rest.api.v2010.account.message.media.MediaInstance]

class twilio.rest.api.v2010.account.message.media.MediaPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of MediaInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.api.v2010.account.message.media.MediaInstance
Return type:twilio.rest.api.v2010.account.message.media.MediaInstance

Module contents

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.api.v2010.account.message.MessageContext(version, account_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the MessageInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
feedback

Access the feedback

Returns:twilio.rest.api.v2010.account.message.feedback.FeedbackList
Return type:twilio.rest.api.v2010.account.message.feedback.FeedbackList
fetch()[source]

Fetch the MessageInstance

Returns:The fetched MessageInstance
Return type:twilio.rest.api.v2010.account.message.MessageInstance
media

Access the media

Returns:twilio.rest.api.v2010.account.message.media.MediaList
Return type:twilio.rest.api.v2010.account.message.media.MediaList
update(body=<object object>, status=<object object>)[source]

Update the MessageInstance

Parameters:
  • body (unicode) – The text of the message you want to send
  • status (MessageInstance.UpdateStatus) – Set as canceled to cancel a message from being sent.
Returns:

The updated MessageInstance

Return type:

twilio.rest.api.v2010.account.message.MessageInstance

class twilio.rest.api.v2010.account.message.MessageInstance(version, payload, account_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class AddressRetention[source]

Bases: object

RETAIN = 'retain'
class ContentRetention[source]

Bases: object

RETAIN = 'retain'
class Direction[source]

Bases: object

INBOUND = 'inbound'
OUTBOUND_API = 'outbound-api'
OUTBOUND_CALL = 'outbound-call'
OUTBOUND_REPLY = 'outbound-reply'
class ScheduleType[source]

Bases: object

FIXED = 'fixed'
class Status[source]

Bases: object

ACCEPTED = 'accepted'
CANCELED = 'canceled'
DELIVERED = 'delivered'
FAILED = 'failed'
PARTIALLY_DELIVERED = 'partially_delivered'
QUEUED = 'queued'
READ = 'read'
RECEIVED = 'received'
RECEIVING = 'receiving'
SCHEDULED = 'scheduled'
SENDING = 'sending'
SENT = 'sent'
UNDELIVERED = 'undelivered'
class TrafficType[source]

Bases: object

FREE = 'free'
class UpdateStatus[source]

Bases: object

CANCELED = 'canceled'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
api_version
Returns:The API version used to process the message
Return type:unicode
body
Returns:The message text
Return type:unicode
date_created
Returns:The RFC 2822 date and time in GMT that the resource was created
Return type:datetime
date_sent
Returns:The RFC 2822 date and time in GMT when the message was sent
Return type:datetime
date_updated
Returns:The RFC 2822 date and time in GMT that the resource was last updated
Return type:datetime
delete()[source]

Deletes the MessageInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
direction
Returns:The direction of the message
Return type:MessageInstance.Direction
error_code
Returns:The error code associated with the message
Return type:unicode
error_message
Returns:The description of the error_code
Return type:unicode
feedback

Access the feedback

Returns:twilio.rest.api.v2010.account.message.feedback.FeedbackList
Return type:twilio.rest.api.v2010.account.message.feedback.FeedbackList
fetch()[source]

Fetch the MessageInstance

Returns:The fetched MessageInstance
Return type:twilio.rest.api.v2010.account.message.MessageInstance
from_
Returns:The phone number that initiated the message
Return type:unicode
media

Access the media

Returns:twilio.rest.api.v2010.account.message.media.MediaList
Return type:twilio.rest.api.v2010.account.message.media.MediaList
messaging_service_sid
Returns:The SID of the Messaging Service used with the message.
Return type:unicode
num_media
Returns:The number of media files associated with the message
Return type:unicode
num_segments
Returns:The number of messages used to deliver the message body
Return type:unicode
price
Returns:The amount billed for the message
Return type:unicode
price_unit
Returns:The currency in which price is measured
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
status
Returns:The status of the message
Return type:MessageInstance.Status
subresource_uris
Returns:A list of related resources identified by their relative URIs
Return type:unicode
to
Returns:The phone number that received the message
Return type:unicode
update(body=<object object>, status=<object object>)[source]

Update the MessageInstance

Parameters:
  • body (unicode) – The text of the message you want to send
  • status (MessageInstance.UpdateStatus) – Set as canceled to cancel a message from being sent.
Returns:

The updated MessageInstance

Return type:

twilio.rest.api.v2010.account.message.MessageInstance

uri
Returns:The URI of the resource, relative to https://api.twilio.com
Return type:unicode
class twilio.rest.api.v2010.account.message.MessageList(version, account_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(to, status_callback=<object object>, application_sid=<object object>, max_price=<object object>, provide_feedback=<object object>, attempt=<object object>, validity_period=<object object>, force_delivery=<object object>, content_retention=<object object>, address_retention=<object object>, smart_encoded=<object object>, persistent_action=<object object>, schedule_type=<object object>, send_at=<object object>, send_as_mms=<object object>, from_=<object object>, messaging_service_sid=<object object>, body=<object object>, media_url=<object object>)[source]

Create the MessageInstance

Parameters:
  • to (unicode) – The destination phone number
  • status_callback (unicode) – The URL we should call to send status information to your application
  • application_sid (unicode) – The application to use for callbacks
  • max_price (unicode) – The total maximum price up to 4 decimal places in US dollars acceptable for the message to be delivered.
  • provide_feedback (bool) – Whether to confirm delivery of the message
  • attempt (unicode) – Total numer of attempts made , this inclusive to send out the message
  • validity_period (unicode) – The number of seconds that the message can remain in our outgoing queue.
  • force_delivery (bool) – Reserved
  • content_retention (MessageInstance.ContentRetention) – Determines if the message content can be stored or redacted based on privacy settings
  • address_retention (MessageInstance.AddressRetention) – Determines if the address can be stored or obfuscated based on privacy settings
  • smart_encoded (bool) – Whether to detect Unicode characters that have a similar GSM-7 character and replace them
  • persistent_action (list[unicode]) – Rich actions for Channels Messages.
  • schedule_type (MessageInstance.ScheduleType) – Pass the value fixed to schedule a message at a fixed time.
  • send_at (datetime) – The time that Twilio will send the message. Must be in ISO 8601 format.
  • send_as_mms (bool) – If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
  • from (unicode) – The phone number that initiated the message
  • messaging_service_sid (unicode) – The SID of the Messaging Service you want to associate with the message.
  • body (unicode) – The text of the message you want to send. Can be up to 1,600 characters in length.
  • media_url (list[unicode]) – The URL of the media to send with the message
Returns:

The created MessageInstance

Return type:

twilio.rest.api.v2010.account.message.MessageInstance

get(sid)[source]

Constructs a MessageContext

Parameters:sid – The unique string that identifies the resource
Returns:twilio.rest.api.v2010.account.message.MessageContext
Return type:twilio.rest.api.v2010.account.message.MessageContext
get_page(target_url)[source]

Retrieve a specific page of MessageInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of MessageInstance
Return type:twilio.rest.api.v2010.account.message.MessagePage
list(to=<object object>, from_=<object object>, date_sent_before=<object object>, date_sent=<object object>, date_sent_after=<object object>, limit=None, page_size=None)[source]

Lists MessageInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • to (unicode) – Filter by messages sent to this number
  • from (unicode) – Filter by from number
  • date_sent_before (datetime) – Filter by date sent
  • date_sent (datetime) – Filter by date sent
  • date_sent_after (datetime) – Filter by date sent
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, list() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
Returns:

Generator that will yield up to limit results

Return type:

list[twilio.rest.api.v2010.account.message.MessageInstance]

page(to=<object object>, from_=<object object>, date_sent_before=<object object>, date_sent=<object object>, date_sent_after=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of MessageInstance records from the API. Request is executed immediately

Parameters:
  • to (unicode) – Filter by messages sent to this number
  • from (unicode) – Filter by from number
  • date_sent_before (datetime) – Filter by date sent
  • date_sent (datetime) – Filter by date sent
  • date_sent_after (datetime) – Filter by date sent
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of MessageInstance

Return type:

twilio.rest.api.v2010.account.message.MessagePage

stream(to=<object object>, from_=<object object>, date_sent_before=<object object>, date_sent=<object object>, date_sent_after=<object object>, limit=None, page_size=None)[source]

Streams MessageInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient.

Parameters:
  • to (unicode) – Filter by messages sent to this number
  • from (unicode) – Filter by from number
  • date_sent_before (datetime) – Filter by date sent
  • date_sent (datetime) – Filter by date sent
  • date_sent_after (datetime) – Filter by date sent
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
Returns:

Generator that will yield up to limit results

Return type:

list[twilio.rest.api.v2010.account.message.MessageInstance]

class twilio.rest.api.v2010.account.message.MessagePage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of MessageInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.api.v2010.account.message.MessageInstance
Return type:twilio.rest.api.v2010.account.message.MessageInstance