twilio.rest.lookups.v2 package

Submodules

twilio.rest.lookups.v2.phone_number module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.lookups.v2.phone_number.PhoneNumberContext(version, phone_number)[source]

Bases: twilio.base.instance_context.InstanceContext

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

fetch(fields=<object object>, country_code=<object object>, first_name=<object object>, last_name=<object object>, address_line_1=<object object>, address_line_2=<object object>, city=<object object>, state=<object object>, postal_code=<object object>, address_country_code=<object object>, national_id=<object object>, date_of_birth=<object object>)[source]

Fetch the PhoneNumberInstance

Parameters:
  • fields (unicode) – Fields to return
  • country_code (unicode) – Country code for national phone number lookups
  • first_name (unicode) – User’s first name.
  • last_name (unicode) – User’s last name.
  • address_line_1 (unicode) – User’s first address line.
  • address_line_2 (unicode) – User’s second address line.
  • city (unicode) – User’s city.
  • state (unicode) – User’s country subdivision, such as state, province, or locality.
  • postal_code (unicode) – User’s postal zip code.
  • address_country_code (unicode) – User’s country, up to two characters.
  • national_id (unicode) – User’s national ID, such as SSN or Passport ID.
  • date_of_birth (unicode) – User’s date of birth, in YYYYMMDD format.
Returns:

The fetched PhoneNumberInstance

Return type:

twilio.rest.lookups.v2.phone_number.PhoneNumberInstance

class twilio.rest.lookups.v2.phone_number.PhoneNumberInstance(version, payload, phone_number=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 Type[source]

Bases: object

LANDLINE = 'landline'
MOBILE = 'mobile'
VOIP = 'voip'
class ValidationError[source]

Bases: object

INVALID_BUT_POSSIBLE = 'INVALID_BUT_POSSIBLE'
INVALID_COUNTRY_CODE = 'INVALID_COUNTRY_CODE'
INVALID_LENGTH = 'INVALID_LENGTH'
NOT_A_NUMBER = 'NOT_A_NUMBER'
TOO_LONG = 'TOO_LONG'
TOO_SHORT = 'TOO_SHORT'
call_forwarding
Returns:An object that contains call forwarding status information
Return type:dict
caller_name
Returns:An object that contains caller name information
Return type:dict
calling_country_code
Returns:International dialing prefix
Return type:unicode
country_code
Returns:Phone number’s ISO country code
Return type:unicode
fetch(fields=<object object>, country_code=<object object>, first_name=<object object>, last_name=<object object>, address_line_1=<object object>, address_line_2=<object object>, city=<object object>, state=<object object>, postal_code=<object object>, address_country_code=<object object>, national_id=<object object>, date_of_birth=<object object>)[source]

Fetch the PhoneNumberInstance

Parameters:
  • fields (unicode) – Fields to return
  • country_code (unicode) – Country code for national phone number lookups
  • first_name (unicode) – User’s first name.
  • last_name (unicode) – User’s last name.
  • address_line_1 (unicode) – User’s first address line.
  • address_line_2 (unicode) – User’s second address line.
  • city (unicode) – User’s city.
  • state (unicode) – User’s country subdivision, such as state, province, or locality.
  • postal_code (unicode) – User’s postal zip code.
  • address_country_code (unicode) – User’s country, up to two characters.
  • national_id (unicode) – User’s national ID, such as SSN or Passport ID.
  • date_of_birth (unicode) – User’s date of birth, in YYYYMMDD format.
Returns:

The fetched PhoneNumberInstance

Return type:

twilio.rest.lookups.v2.phone_number.PhoneNumberInstance

identity_match
Returns:An object that contains identity match information
Return type:dict
line_type_intelligence
Returns:An object that contains line type information
Return type:dict
live_activity
Returns:An object that contains live activity information
Return type:dict
national_format
Returns:Phone number in national format
Return type:unicode
phone_number
Returns:Phone number in E.164 format
Return type:unicode
sim_swap
Returns:An object that contains SIM swap information
Return type:dict
url
Returns:The absolute URL of the resource
Return type:unicode
valid
Returns:Boolean which indicates if the phone number is valid
Return type:bool
validation_errors
Returns:Contains reasons why a phone number is invalid
Return type:list[PhoneNumberInstance.ValidationError]
class twilio.rest.lookups.v2.phone_number.PhoneNumberList(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.

get(phone_number)[source]

Constructs a PhoneNumberContext

Parameters:phone_number – Phone number to lookup
Returns:twilio.rest.lookups.v2.phone_number.PhoneNumberContext
Return type:twilio.rest.lookups.v2.phone_number.PhoneNumberContext
class twilio.rest.lookups.v2.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.lookups.v2.phone_number.PhoneNumberInstance
Return type:twilio.rest.lookups.v2.phone_number.PhoneNumberInstance

Module contents

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.lookups.v2.V2(domain)[source]

Bases: twilio.base.version.Version

phone_numbers
Return type:twilio.rest.lookups.v2.phone_number.PhoneNumberList