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: str | None = 'callerId'
read(entity_id: str, org_id: str = 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, selected: CallerIdSelectedType = None, custom_number: str = None, first_name: str = None, last_name: str = None, external_caller_id_name_policy: ExternalCallerIdNamePolicy = None, custom_external_caller_id_name: str = 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)[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: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None = None, extensionNumber: str | None = None, locationNumber: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None = None, mobileNumber: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None = None, tollFreeLocationNumber: bool | None = None, customNumber: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | 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, displayName: str | None = None, displayDetail: str | None = None, directLineCallerIdName: DirectLineCallerIdName | None = None, dialByName: str | None = None, dialByFirstName: str | None = None, dialByLastName: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

Caller id settings of a user, also used for workspaces, virtual lines, …

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.

direct_number: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None

Direct number which will be shown if DIRECT_LINE is selected.

extension_number: str | None

Extension number which will be shown if DIRECT_LINE is selected.

location_number: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None

Location number which will be shown if LOCATION_NUMBER is selected.

mobile_number: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None

Mobile number which will be shown if MOBILE_NUMBER is selected.

toll_free_location_number: bool | None

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

custom_number: Annotated[str, BeforeValidator(func=e164, json_schema_input_type=PydanticUndefined)] | None

Custom number which is shown if CUSTOM is selected. This value must be a number from the workspace’s location or from another location with the same country, PSTN provider, and zone (only applicable for India locations) as the workspace’s location.

first_name: str | None

Person’s Caller ID first name. The characters %, +, ``, and Unicode characters are not allowed. field has been deprecated. Please use directLineCallerIdName and dialByFirstName instead.

last_name: str | None

Person’s Caller ID last name. The characters %, +, ``, and Unicode characters are not allowed. field has been deprecated. Please use directLineCallerIdName and dialByLastName instead.

block_in_forward_calls_enabled: bool | None

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

external_caller_id_name_policy: ExternalCallerIdNamePolicy | None

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

custom_external_caller_id_name: str | None

Custom External Caller Name, which will be shown if External Caller Id Name is OTHER.

location_external_caller_id_name: str | None

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

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.

display_name: str | None

Workspace’s caller ID display name. This field has been deprecated. Please use directLineCallerIdName and dialByName instead.

display_detail: str | None

Workspace’s caller ID display details. Default is .. This field has been deprecated. Please use directLineCallerIdName and dialByName instead.

direct_line_caller_id_name: DirectLineCallerIdName | None

Settings for the direct line caller ID name to be shown for this workspace.

dial_by_name: str | None

The name to be used for dial by name functions.

dial_by_first_name: str | None

The first name to be used for dial by name functions.

dial_by_last_name: str | None

The last name to be used for dial by name functions.

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', 'dial_by_first_name', 'dial_by_last_name', 'dial_by_name', 'direct_line_caller_id_name', 'display_detail', 'display_name', '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(*values)[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(*values)[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.