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, ringPattern: RingPattern | None = None)[source]
Bases:
ApiModelInformation about a phone number
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- primary: bool
Flag to indicate primary number or not.
- direct_number: str | None
Phone Number.
- extension: str | None
Extension
- 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[wxc_sdk.person_settings.numbers.PersonPhoneNumber])[source]
Bases:
ApiModelInformation about person’s phone numbers
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- distinctive_ring_enabled: bool
To enable/disable distinctive ring pattern that identifies calls coming from a specific phone number.
- phone_numbers: list[wxc_sdk.person_settings.numbers.PersonPhoneNumber]
Information about the number.
- class wxc_sdk.person_settings.numbers.UpdatePersonPhoneNumber(*, primary: bool = False, action: PatternAction, external: str, extension: str | None = None, ringPattern: RingPattern | None = None)[source]
Bases:
ApiModelInformation about a phone number
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- primary: bool
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[wxc_sdk.person_settings.numbers.UpdatePersonPhoneNumber])[source]
Bases:
ApiModelInformation about person’s phone numbers
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- enable_distinctive_ring_pattern: bool | None
This enable distinctive ring pattern for the person.
- phone_numbers: list[wxc_sdk.person_settings.numbers.UpdatePersonPhoneNumber]
Information about the number.
- class wxc_sdk.person_settings.numbers.NumbersApi(*, session: RestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
PersonSettingsApiChildAPI for person’s numbers
- feature = 'numbers'
- read(person_id: str, 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.
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:
- 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 applyorg_id (str) – organization to work on
- base = ''
- session: RestSession
REST session