wxc_sdk.person_settings.numbers module

Person numbers API

class wxc_sdk.person_settings.numbers.PersonPhoneNumber(*, primary: bool, directNumber: str | None = None, extension: str | None = None, routingPrefix: str | None = None, esn: str | None = None, ringPattern: RingPattern | None = None)[source]

Bases: ApiModel

Information about a phone number

primary: bool

Flag to indicate primary number or not.

direct_number: str | None

Phone Number.

extension: str | None

Extension

routing_prefix: str | None

Routing prefix of location.

esn: str | None

Routing prefix + extension of a person or workspace.

ring_pattern: RingPattern | None

Optional ring pattern and this is applicable only for alternate numbers.

class wxc_sdk.person_settings.numbers.PersonNumbers(*, distinctiveRingEnabled: bool, phoneNumbers: list[PersonPhoneNumber])[source]

Bases: ApiModel

Information about person’s phone numbers

distinctive_ring_enabled: bool

To enable/disable distinctive ring pattern that identifies calls coming from a specific phone number.

phone_numbers: list[PersonPhoneNumber]

Information about the number.

class wxc_sdk.person_settings.numbers.UpdatePersonPhoneNumber(*, primary: Literal[False] = False, action: PatternAction, external: str, extension: str | None = None, ringPattern: RingPattern | None = None)[source]

Bases: ApiModel

Information about a phone number

primary: Literal[False]

Flag to indicate primary number or not.

action: PatternAction

This is either ‘ADD’ to add phone numbers or ‘DELETE’ to remove phone numbers.

external: str

Phone numbers that are assigned.

extension: str | None

Extension that is being assigned.

ring_pattern: RingPattern | None

Ring Pattern of this number.

class wxc_sdk.person_settings.numbers.UpdatePersonNumbers(*, enableDistinctiveRingPattern: bool | None = None, phoneNumbers: list[UpdatePersonPhoneNumber])[source]

Bases: ApiModel

Information about person’s phone numbers

enable_distinctive_ring_pattern: bool | None

This enable distinctive ring pattern for the person.

phone_numbers: list[UpdatePersonPhoneNumber]

Information about the number.

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

Bases: PersonSettingsApiChild

API for person’s numbers

feature = 'numbers'
read(person_id: str, prefer_e164_format: bool | None = None, org_id: str | None = None) PersonNumbers[source]

Get a person’s phone numbers including alternate numbers.

A person can have one or more phone numbers and/or extensions via which they can be called.

This API requires a full or user administrator auth token with the spark-admin:people_read scope.

Parameters:
  • person_id (str) – Unique identifier for the person.

  • prefer_e164_format (bool) – Return phone numbers in E.164 format.

  • org_id (str) – Person 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.

Returns:

Alternate numbers of the user

Return type:

PersonNumbers

update(person_id: str, update: UpdatePersonNumbers, org_id: str | None = None)[source]

Assign or unassign alternate phone numbers to a person.

Each location has a set of phone numbers that can be assigned to people, workspaces, or features. Phone numbers must follow E.164 format for all countries, except for the United States, which can also follow the National format. Active phone numbers are in service.

Assigning or Unassigning an alternate phone number to a person requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • person_id (str) – Unique identifier of the person.

  • update (UpdatePersonNumbers) – Update to apply

  • org_id (str) – organization to work on

base = ''