wxc_sdk.person_settings.caller_id module

class wxc_sdk.person_settings.caller_id.CallerIdApi(*, session: RestSession, selector: ApiSelector = ApiSelector.person)[source]

Bases: PersonSettingsApiChild

API for caller id settings

Also used for: virtual lines, workspaces

feature = 'callerId'
read(entity_id: str, org_id: str | None = None) CallerId[source]

Retrieve Caller ID Settings

Caller ID settings control how a entity’s information is displayed when making outgoing calls.

This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read or a user auth token with spark:people_read scope can be used by a entity to read their settings.

Parameters:
  • entity_id (str) – Unique identifier for the entity.

  • org_id (str) – entity is in this organization. Only admin users of another organization (such as partners) may use this parameter as the default is the same organization as the token used to access API.

configure(entity_id: str, org_id: str | None = None, selected: CallerIdSelectedType | None = None, custom_number: str | None = None, first_name: str | None = None, last_name: str | None = None, external_caller_id_name_policy: ExternalCallerIdNamePolicy | None = None, custom_external_caller_id_name: str | None = None)[source]

Configure a Caller ID Settings

Caller ID settings control how a entity’s information is displayed when making outgoing calls.

This API requires a full or user administrator auth token with the spark-admin:people_write scope or a user auth token with spark:people_write scope can be used by a entity to update their own settings.

Parameters:
  • entity_id (str) – Unique identifier for the entity.

  • org_id (str) – entity is in this organization. Only admin users of another organization (such as partners) may use this parameter as the default is the same organization as the token used to access API.

  • selected (CallerIdSelectedType) – Which type of outgoing Caller ID will be used.

  • custom_number (str) – This value must be an assigned number from the entity’s location.

  • first_name (str) – entity’s Caller ID first name. Characters of %, +, `, “ and Unicode characters are not allowed.

  • last_name (str) – entity’s Caller ID last name. Characters of %, +, `, “ and Unicode characters are not allowed.

  • external_caller_id_name_policy (ExternalCallerIdNamePolicy) – Designates which type of External Caller ID Name policy is used. Default is DIRECT_LINE.

  • custom_external_caller_id_name (str) – Custom External Caller Name, which will be shown if External Caller ID Name is OTHER.

configure_settings(entity_id: str, settings: CallerId, org_id: str | None = None)[source]

Configure a Caller ID Settings

Caller ID settings control how a entity’s information is displayed when making outgoing calls.

This API requires a full or user administrator auth token with the spark-admin:people_write scope or a user auth token with spark:people_write scope can be used by a entity to update their own settings.

Parameters:
  • entity_id (str) – Unique identifier for the entity.

  • settings (CallerId) – new settings

  • org_id (str) – entity is in this organization. Only admin users of another organization (such as partners) may use this parameter as the default is the same organization as the token used to access API.

Example

api = self.api.telephony.virtual_lines.caller_id
caller_id_settings = api.read(entity_id=self.target.id)
caller_id_settings.block_in_forward_calls_enabled = True
api.configure_settings(entity_id=self.target.id, settings=caller_id_settings)
base = ''
class wxc_sdk.person_settings.caller_id.CallerId(*, types: list[CallerIdSelectedType] | None = None, selected: CallerIdSelectedType | None = None, directNumber: str | None = None, extensionNumber: str | None = None, locationNumber: str | None = None, mobileNumber: str | None = None, tollFreeLocationNumber: bool | None = None, customNumber: str | None = None, firstName: str | None = None, lastName: str | None = None, blockInForwardCallsEnabled: bool | None = None, externalCallerIdNamePolicy: ExternalCallerIdNamePolicy | None = None, customExternalCallerIdName: str | None = None, locationExternalCallerIdName: str | None = None, additionalExternalCallerIdDirectLineEnabled: bool | None = None, additionalExternalCallerIdLocationNumberEnabled: bool | None = None, additionalExternalCallerIdCustomNumber: str | None = None)[source]

Bases: ApiModel

Caller id settings of a user

caller_id_types: list[CallerIdSelectedType] | None

Allowed types for the selected field. This field is read-only and cannot be modified.

selected: CallerIdSelectedType | None

Which type of outgoing Caller ID will be used. This setting is for the number portion. example: DIRECT_LINE

direct_number: str | None

Direct number which will be shown if DIRECT_LINE is selected. example: 2025551212

extension_number: str | None

Extension number which will be shown if DIRECT_LINE is selected. example: 3456

location_number: str | None

Location number which will be shown if LOCATION_NUMBER is selected. example: 2025551212

mobile_number: str | None

Mobile number which will be shown if MOBILE_NUMBER is selected. example: 2025552121

toll_free_location_number: bool | None

Flag to indicate if the location number is toll-free number.

custom_number: str | None

This value must be an assigned number from the virtual line’s location. example: 2025551212

first_name: str | None

Person’s Caller ID first name. The characters %, +, ``, and Unicode characters are not allowed. example: Hakim

last_name: str | None

Person’s Caller ID last name. The characters %, +, ``, and Unicode characters are not allowed. example: Gonzales

block_in_forward_calls_enabled: bool | None

true if the virtual line’s identity is blocked when receiving a transferred or forwarded call. example: True

external_caller_id_name_policy: ExternalCallerIdNamePolicy | None

Designates which type of External Caller Id Name policy is used. Default is DIRECT_LINE. example: DIRECT_LINE

custom_external_caller_id_name: str | None

Custom External Caller Name, which will be shown if External Caller Id Name is OTHER. example: Hakim custom

location_external_caller_id_name: str | None

Location’s caller ID. This field is read-only and cannot be modified. example: Hakim location

additional_external_caller_id_direct_line_enabled: bool | None

To set the user’s main number as additional external caller ID.

additional_external_caller_id_location_number_enabled: bool | None

To set the Location main number as additional external caller ID for the user.

additional_external_caller_id_custom_number: str | None

To set any phone number across location as additional external caller ID for the user.

fields_for_update: ClassVar[set[str]] = {'additional_external_caller_id_custom_number', 'additional_external_caller_id_direct_line_enabled', 'block_in_forward_calls_enabled', 'custom_external_caller_id_name', 'custom_number', 'external_caller_id_name_policy', 'first_name', 'last_name', 'location_external_caller_id_name', 'selected'}
configure_params() dict[source]

Get a dict with values that can be used to configure the caller id settings

Returns:

dict

Return type:

dict

Example:

caller_id = wx_api.person_settings.caller_id.read(person_id=...)
caller_id.first_name = 'Bob'
wx_api.person_settings.caller_id.configure(person_id=...,
                                           **caller_id.configure_params())
class wxc_sdk.person_settings.caller_id.ExternalCallerIdNamePolicy(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

Designates which type of External Caller ID Name policy is used. Default is DIRECT_LINE.

direct_line = 'DIRECT_LINE'

Outgoing caller ID will show the caller’s direct line name

location = 'LOCATION'

Outgoing caller ID will show the Site Name for the location.

other = 'OTHER'

Outgoing caller ID will show the value from the custom_external_caller_id_name field.

class wxc_sdk.person_settings.caller_id.CallerIdSelectedType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

Allowed types for the selected field.

direct_line = 'DIRECT_LINE'

Outgoing caller ID will show the caller’s direct line number and/or extension.

location_number = 'LOCATION_NUMBER'

Outgoing caller ID will show the main number for the location.

mobile_number = 'MOBILE_NUMBER'

Outgoing caller ID will show the mobile number for this person.

custom = 'CUSTOM'

Outgoing caller ID will show the value from the customNumber field.