twilio.rest.messaging.v1.service package

Submodules

twilio.rest.messaging.v1.service.alpha_sender module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

delete()[source]

Deletes the AlphaSenderInstance

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

Fetch the AlphaSenderInstance

Returns:The fetched AlphaSenderInstance
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
class twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance(version, payload, service_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
alpha_sender
Returns:The Alphanumeric Sender ID string
Return type:unicode
capabilities
Returns:An array of values that describe whether the number can receive calls or messages
Return type:list[unicode]
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the AlphaSenderInstance

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

Fetch the AlphaSenderInstance

Returns:The fetched AlphaSenderInstance
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
url
Returns:The absolute URL of the AlphaSender resource
Return type:unicode
class twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

create(alpha_sender)[source]

Create the AlphaSenderInstance

Parameters:alpha_sender (unicode) – The Alphanumeric Sender ID string
Returns:The created AlphaSenderInstance
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
get(sid)[source]

Constructs a AlphaSenderContext

Parameters:sid – The SID that identifies the resource to fetch
Returns:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of AlphaSenderInstance
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage
list(limit=None, page_size=None)[source]

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

Parameters:
  • 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.messaging.v1.service.alpha_sender.AlphaSenderInstance]

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

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

Parameters:
  • 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 AlphaSenderInstance

Return type:

twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage

stream(limit=None, page_size=None)[source]

Streams AlphaSenderInstance 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:
  • 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.messaging.v1.service.alpha_sender.AlphaSenderInstance]

class twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderPage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of AlphaSenderInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance

twilio.rest.messaging.v1.service.phone_number module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.phone_number.PhoneNumberContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

delete()[source]

Deletes the PhoneNumberInstance

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

Fetch the PhoneNumberInstance

Returns:The fetched PhoneNumberInstance
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance
class twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance(version, payload, service_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
capabilities
Returns:An array of values that describe whether the number can receive calls or messages
Return type:list[unicode]
country_code
Returns:The 2-character ISO Country Code of the number
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the PhoneNumberInstance

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

Fetch the PhoneNumberInstance

Returns:The fetched PhoneNumberInstance
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance
phone_number
Returns:The phone number in E.164 format
Return type:unicode
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
url
Returns:The absolute URL of the PhoneNumber resource
Return type:unicode
class twilio.rest.messaging.v1.service.phone_number.PhoneNumberList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

create(phone_number_sid)[source]

Create the PhoneNumberInstance

Parameters:phone_number_sid (unicode) – The SID of the Phone Number being added to the Service
Returns:The created PhoneNumberInstance
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance
get(sid)[source]

Constructs a PhoneNumberContext

Parameters:sid – The SID that identifies the resource to fetch
Returns:twilio.rest.messaging.v1.service.phone_number.PhoneNumberContext
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of PhoneNumberInstance
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberPage
list(limit=None, page_size=None)[source]

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

Parameters:
  • 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.messaging.v1.service.phone_number.PhoneNumberInstance]

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

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

Parameters:
  • 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 PhoneNumberInstance

Return type:

twilio.rest.messaging.v1.service.phone_number.PhoneNumberPage

stream(limit=None, page_size=None)[source]

Streams PhoneNumberInstance 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:
  • 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.messaging.v1.service.phone_number.PhoneNumberInstance]

class twilio.rest.messaging.v1.service.phone_number.PhoneNumberPage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of PhoneNumberInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberInstance

twilio.rest.messaging.v1.service.short_code module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.short_code.ShortCodeContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

delete()[source]

Deletes the ShortCodeInstance

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

Fetch the ShortCodeInstance

Returns:The fetched ShortCodeInstance
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeInstance
class twilio.rest.messaging.v1.service.short_code.ShortCodeInstance(version, payload, service_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
capabilities
Returns:An array of values that describe whether the number can receive calls or messages
Return type:list[unicode]
country_code
Returns:The 2-character ISO Country Code of the number
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the ShortCodeInstance

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

Fetch the ShortCodeInstance

Returns:The fetched ShortCodeInstance
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeInstance
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
short_code
Returns:The E.164 format of the short code
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
url
Returns:The absolute URL of the ShortCode resource
Return type:unicode
class twilio.rest.messaging.v1.service.short_code.ShortCodeList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

create(short_code_sid)[source]

Create the ShortCodeInstance

Parameters:short_code_sid (unicode) – The SID of the ShortCode being added to the Service
Returns:The created ShortCodeInstance
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeInstance
get(sid)[source]

Constructs a ShortCodeContext

Parameters:sid – The SID that identifies the resource to fetch
Returns:twilio.rest.messaging.v1.service.short_code.ShortCodeContext
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of ShortCodeInstance
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodePage
list(limit=None, page_size=None)[source]

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

Parameters:
  • 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.messaging.v1.service.short_code.ShortCodeInstance]

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

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

Parameters:
  • 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 ShortCodeInstance

Return type:

twilio.rest.messaging.v1.service.short_code.ShortCodePage

stream(limit=None, page_size=None)[source]

Streams ShortCodeInstance 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:
  • 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.messaging.v1.service.short_code.ShortCodeInstance]

class twilio.rest.messaging.v1.service.short_code.ShortCodePage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of ShortCodeInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.short_code.ShortCodeInstance
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeInstance

twilio.rest.messaging.v1.service.us_app_to_person module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonContext(version, messaging_service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

delete()[source]

Deletes the UsAppToPersonInstance

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

Fetch the UsAppToPersonInstance

Returns:The fetched UsAppToPersonInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance
class twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance(version, payload, messaging_service_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
brand_registration_sid
Returns:A2P Brand Registration SID
Return type:unicode
campaign_id
Returns:The Campaign Registry (TCR) Campaign ID.
Return type:unicode
campaign_status
Returns:Campaign status
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the UsAppToPersonInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
description
Returns:A short description of what this SMS campaign does
Return type:unicode
fetch()[source]

Fetch the UsAppToPersonInstance

Returns:The fetched UsAppToPersonInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance
Returns:Indicate that this SMS campaign will send messages that contain links
Return type:bool
has_embedded_phone
Returns:Indicates that this SMS campaign will send messages that contain phone numbers
Return type:bool
help_keywords
Returns:Help Keywords
Return type:list[unicode]
help_message
Returns:Help Message
Return type:unicode
is_externally_registered
Returns:Indicates whether the campaign was registered externally or not
Return type:bool
message_flow
Returns:Consumer opt-in flow
Return type:unicode
message_samples
Returns:Message samples
Return type:list[unicode]
messaging_service_sid
Returns:The SID of the Messaging Service the resource is associated with
Return type:unicode
mock
Returns:A boolean that specifies whether campaign is a mock or not.
Return type:bool
opt_in_keywords
Returns:Opt In Keywords
Return type:list[unicode]
opt_in_message
Returns:Opt In Message
Return type:unicode
opt_out_keywords
Returns:Opt Out Keywords
Return type:list[unicode]
opt_out_message
Returns:Opt Out Message
Return type:unicode
rate_limits
Returns:Rate limit and/or classification set by each carrier
Return type:dict
sid
Returns:The unique string that identifies a US A2P Compliance resource
Return type:unicode
url
Returns:The absolute URL of the US App to Person resource
Return type:unicode
us_app_to_person_usecase
Returns:A2P Campaign Use Case.
Return type:unicode
class twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonList(version, messaging_service_sid)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

create(brand_registration_sid, description, message_samples, us_app_to_person_usecase, has_embedded_links, has_embedded_phone, message_flow=<object object>, opt_in_message=<object object>, opt_out_message=<object object>, help_message=<object object>, opt_in_keywords=<object object>, opt_out_keywords=<object object>, help_keywords=<object object>)[source]

Create the UsAppToPersonInstance

Parameters:
  • brand_registration_sid (unicode) – A2P Brand Registration SID
  • description (unicode) – A short description of what this SMS campaign does
  • message_samples (list[unicode]) – Message samples
  • us_app_to_person_usecase (unicode) – A2P Campaign Use Case.
  • has_embedded_links (bool) – Indicates that this SMS campaign will send messages that contain links
  • has_embedded_phone (bool) – Indicates that this SMS campaign will send messages that contain phone numbers
  • message_flow (unicode) – The message flow of the campaign
  • opt_in_message (unicode) – Opt In Message
  • opt_out_message (unicode) – Opt Out Message
  • help_message (unicode) – Help Message
  • opt_in_keywords (list[unicode]) – Opt In Keywords
  • opt_out_keywords (list[unicode]) – Opt Out Keywords
  • help_keywords (list[unicode]) – Help Keywords
Returns:

The created UsAppToPersonInstance

Return type:

twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance

get(sid)[source]

Constructs a UsAppToPersonContext

Parameters:sid – The SID that identifies the US A2P Compliance resource to fetch
Returns:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonContext
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of UsAppToPersonInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonPage
list(limit=None, page_size=None)[source]

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

Parameters:
  • 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.messaging.v1.service.us_app_to_person.UsAppToPersonInstance]

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

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

Parameters:
  • 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 UsAppToPersonInstance

Return type:

twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonPage

stream(limit=None, page_size=None)[source]

Streams UsAppToPersonInstance 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:
  • 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.messaging.v1.service.us_app_to_person.UsAppToPersonInstance]

class twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonPage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of UsAppToPersonInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonInstance

twilio.rest.messaging.v1.service.us_app_to_person_usecase module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseInstance(version, payload, messaging_service_sid)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

us_app_to_person_usecases
Returns:Human readable A2P Use Case details
Return type:list[dict]
class twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseList(version, messaging_service_sid)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

fetch(brand_registration_sid=<object object>)[source]

Fetch the UsAppToPersonUsecaseInstance

Parameters:brand_registration_sid (unicode) – A2P Brand Registration SID
Returns:The fetched UsAppToPersonUsecaseInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseInstance
class twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecasePage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of UsAppToPersonUsecaseInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseInstance
Return type:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseInstance

Module contents

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.messaging.v1.service.ServiceContext(version, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

alpha_senders

Access the alpha_senders

Returns:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList
delete()[source]

Deletes the ServiceInstance

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

Fetch the ServiceInstance

Returns:The fetched ServiceInstance
Return type:twilio.rest.messaging.v1.service.ServiceInstance
phone_numbers

Access the phone_numbers

Returns:twilio.rest.messaging.v1.service.phone_number.PhoneNumberList
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberList
short_codes

Access the short_codes

Returns:twilio.rest.messaging.v1.service.short_code.ShortCodeList
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeList
update(friendly_name=<object object>, inbound_request_url=<object object>, inbound_method=<object object>, fallback_url=<object object>, fallback_method=<object object>, status_callback=<object object>, sticky_sender=<object object>, mms_converter=<object object>, smart_encoding=<object object>, scan_message_content=<object object>, fallback_to_long_code=<object object>, area_code_geomatch=<object object>, validity_period=<object object>, synchronous_validation=<object object>, usecase=<object object>, use_inbound_webhook_on_number=<object object>)[source]

Update the ServiceInstance

Parameters:
  • friendly_name (unicode) – A string to describe the resource
  • inbound_request_url (unicode) – The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • inbound_method (unicode) – The HTTP method we should use to call inbound_request_url
  • fallback_url (unicode) – The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • fallback_method (unicode) – The HTTP method we should use to call fallback_url
  • status_callback (unicode) – The URL we should call to pass status updates about message delivery
  • sticky_sender (bool) – Whether to enable Sticky Sender on the Service instance
  • mms_converter (bool) – Whether to enable the MMS Converter for messages sent through the Service instance
  • smart_encoding (bool) – Whether to enable Encoding for messages sent through the Service instance
  • scan_message_content (ServiceInstance.ScanMessageContent) – Reserved
  • fallback_to_long_code (bool) – Whether to enable Fallback to Long Code for messages sent through the Service instance
  • area_code_geomatch (bool) – Whether to enable Area Code Geomatch on the Service Instance
  • validity_period (unicode) – How long, in seconds, messages sent from the Service are valid
  • synchronous_validation (bool) – Reserved
  • usecase (unicode) – A string describing the scenario in which the Messaging Service will be used
  • use_inbound_webhook_on_number (bool) – If enabled, the webhook url configured on the phone number will be used and will override the inbound_request_url/fallback_url url called when an inbound message is received.
Returns:

The updated ServiceInstance

Return type:

twilio.rest.messaging.v1.service.ServiceInstance

us_app_to_person

Access the us_app_to_person

Returns:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonList
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonList
us_app_to_person_usecases

Access the us_app_to_person_usecases

Returns:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseList
Return type:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseList
class twilio.rest.messaging.v1.service.ServiceInstance(version, payload, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

class ScanMessageContent[source]

Bases: object

DISABLE = 'disable'
ENABLE = 'enable'
INHERIT = 'inherit'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
alpha_senders

Access the alpha_senders

Returns:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList
Return type:twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderList
area_code_geomatch
Returns:Whether to enable Area Code Geomatch on the Service Instance
Return type:bool
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the ServiceInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fallback_method
Returns:The HTTP method we use to call fallback_url
Return type:unicode
fallback_to_long_code
Returns:Whether to enable Fallback to Long Code for messages sent through the Service instance
Return type:bool
fallback_url
Returns:The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
Return type:unicode
fetch()[source]

Fetch the ServiceInstance

Returns:The fetched ServiceInstance
Return type:twilio.rest.messaging.v1.service.ServiceInstance
friendly_name
Returns:The string that you assigned to describe the resource
Return type:unicode
inbound_method
Returns:The HTTP method we use to call inbound_request_url
Return type:unicode
inbound_request_url
Returns:The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
Return type:unicode
Returns:The absolute URLs of related resources
Return type:unicode
mms_converter
Returns:Whether to enable the MMS Converter for messages sent through the Service instance
Return type:bool
phone_numbers

Access the phone_numbers

Returns:twilio.rest.messaging.v1.service.phone_number.PhoneNumberList
Return type:twilio.rest.messaging.v1.service.phone_number.PhoneNumberList
scan_message_content
Returns:Reserved
Return type:ServiceInstance.ScanMessageContent
short_codes

Access the short_codes

Returns:twilio.rest.messaging.v1.service.short_code.ShortCodeList
Return type:twilio.rest.messaging.v1.service.short_code.ShortCodeList
sid
Returns:The unique string that identifies the resource
Return type:unicode
smart_encoding
Returns:Whether to enable Encoding for messages sent through the Service instance
Return type:bool
status_callback
Returns:The URL we call to pass status updates about message delivery
Return type:unicode
sticky_sender
Returns:Whether to enable Sticky Sender on the Service instance
Return type:bool
synchronous_validation
Returns:Reserved
Return type:bool
update(friendly_name=<object object>, inbound_request_url=<object object>, inbound_method=<object object>, fallback_url=<object object>, fallback_method=<object object>, status_callback=<object object>, sticky_sender=<object object>, mms_converter=<object object>, smart_encoding=<object object>, scan_message_content=<object object>, fallback_to_long_code=<object object>, area_code_geomatch=<object object>, validity_period=<object object>, synchronous_validation=<object object>, usecase=<object object>, use_inbound_webhook_on_number=<object object>)[source]

Update the ServiceInstance

Parameters:
  • friendly_name (unicode) – A string to describe the resource
  • inbound_request_url (unicode) – The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • inbound_method (unicode) – The HTTP method we should use to call inbound_request_url
  • fallback_url (unicode) – The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • fallback_method (unicode) – The HTTP method we should use to call fallback_url
  • status_callback (unicode) – The URL we should call to pass status updates about message delivery
  • sticky_sender (bool) – Whether to enable Sticky Sender on the Service instance
  • mms_converter (bool) – Whether to enable the MMS Converter for messages sent through the Service instance
  • smart_encoding (bool) – Whether to enable Encoding for messages sent through the Service instance
  • scan_message_content (ServiceInstance.ScanMessageContent) – Reserved
  • fallback_to_long_code (bool) – Whether to enable Fallback to Long Code for messages sent through the Service instance
  • area_code_geomatch (bool) – Whether to enable Area Code Geomatch on the Service Instance
  • validity_period (unicode) – How long, in seconds, messages sent from the Service are valid
  • synchronous_validation (bool) – Reserved
  • usecase (unicode) – A string describing the scenario in which the Messaging Service will be used
  • use_inbound_webhook_on_number (bool) – If enabled, the webhook url configured on the phone number will be used and will override the inbound_request_url/fallback_url url called when an inbound message is received.
Returns:

The updated ServiceInstance

Return type:

twilio.rest.messaging.v1.service.ServiceInstance

url
Returns:The absolute URL of the Service resource
Return type:unicode
us_app_to_person

Access the us_app_to_person

Returns:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonList
Return type:twilio.rest.messaging.v1.service.us_app_to_person.UsAppToPersonList
us_app_to_person_registered
Returns:Whether US A2P campaign is registered for this Service.
Return type:bool
us_app_to_person_usecases

Access the us_app_to_person_usecases

Returns:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseList
Return type:twilio.rest.messaging.v1.service.us_app_to_person_usecase.UsAppToPersonUsecaseList
use_inbound_webhook_on_number
Returns:If enabled, the webhook url configured on the phone number will be used and will override the inbound_request_url/fallback_url url called when an inbound message is received.
Return type:bool
usecase
Returns:A string describing the scenario in which the Messaging Service will be used
Return type:unicode
validity_period
Returns:How long, in seconds, messages sent from the Service are valid
Return type:unicode
class twilio.rest.messaging.v1.service.ServiceList(version)[source]

Bases: twilio.base.list_resource.ListResource

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

create(friendly_name, inbound_request_url=<object object>, inbound_method=<object object>, fallback_url=<object object>, fallback_method=<object object>, status_callback=<object object>, sticky_sender=<object object>, mms_converter=<object object>, smart_encoding=<object object>, scan_message_content=<object object>, fallback_to_long_code=<object object>, area_code_geomatch=<object object>, validity_period=<object object>, synchronous_validation=<object object>, usecase=<object object>, use_inbound_webhook_on_number=<object object>)[source]

Create the ServiceInstance

Parameters:
  • friendly_name (unicode) – A string to describe the resource
  • inbound_request_url (unicode) – The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • inbound_method (unicode) – The HTTP method we should use to call inbound_request_url
  • fallback_url (unicode) – The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the use_inbound_webhook_on_number field is enabled.
  • fallback_method (unicode) – The HTTP method we should use to call fallback_url
  • status_callback (unicode) – The URL we should call to pass status updates about message delivery
  • sticky_sender (bool) – Whether to enable Sticky Sender on the Service instance
  • mms_converter (bool) – Whether to enable the MMS Converter for messages sent through the Service instance
  • smart_encoding (bool) – Whether to enable Encoding for messages sent through the Service instance
  • scan_message_content (ServiceInstance.ScanMessageContent) – Reserved
  • fallback_to_long_code (bool) – Whether to enable Fallback to Long Code for messages sent through the Service instance
  • area_code_geomatch (bool) – Whether to enable Area Code Geomatch on the Service Instance
  • validity_period (unicode) – How long, in seconds, messages sent from the Service are valid
  • synchronous_validation (bool) – Reserved
  • usecase (unicode) – A string describing the scenario in which the Messaging Service will be used
  • use_inbound_webhook_on_number (bool) – If enabled, the webhook url configured on the phone number will be used and will override the inbound_request_url/fallback_url url called when an inbound message is received.
Returns:

The created ServiceInstance

Return type:

twilio.rest.messaging.v1.service.ServiceInstance

get(sid)[source]

Constructs a ServiceContext

Parameters:sid – The SID that identifies the resource to fetch
Returns:twilio.rest.messaging.v1.service.ServiceContext
Return type:twilio.rest.messaging.v1.service.ServiceContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of ServiceInstance
Return type:twilio.rest.messaging.v1.service.ServicePage
list(limit=None, page_size=None)[source]

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

Parameters:
  • 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.messaging.v1.service.ServiceInstance]

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

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

Parameters:
  • 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 ServiceInstance

Return type:

twilio.rest.messaging.v1.service.ServicePage

stream(limit=None, page_size=None)[source]

Streams ServiceInstance 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:
  • 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.messaging.v1.service.ServiceInstance]

class twilio.rest.messaging.v1.service.ServicePage(version, response, solution)[source]

Bases: twilio.base.page.Page

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

get_instance(payload)[source]

Build an instance of ServiceInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.messaging.v1.service.ServiceInstance
Return type:twilio.rest.messaging.v1.service.ServiceInstance