wxc_sdk.as_api module
- class wxc_sdk.as_api.AsAccessCodesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Access codes API
- async read(location_id: str, org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
Get Location Access Code
Retrieve access codes details for a customer location.
Use Access Codes to bypass the set permissions for all persons/workspaces at this location.
Retrieving access codes details requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve access codes details for this location.
org_id (str) – Retrieve access codes details for a customer location in this organization
- Returns:
list of
wxc_sdk.common.CallPark
- async create(location_id: str, access_codes: list[wxc_sdk.common.AuthCode], org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
Create access code in location
- Parameters:
location_id (str) – Add new access code for this location.
access_codes (list of
wxc_sdk.common.AuthCode
) – Access code detailsorg_id (str) – Add new access code for this organization.
- async delete_codes(location_id: str, access_codes: list[Union[str, wxc_sdk.common.AuthCode]], org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
Delete Access Code Location
Deletes the access code details for a particular location for a customer.
Use Access Codes to bypass the set permissions for all persons/workspaces at this location.
Modifying the access code location details requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Deletes the access code details for this location.
access_codes (list of
wxc_sdk.common.AuthCode
or str) – access codes to deleteorg_id (str) – Delete access codes from this organization.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAgentCallerIdApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API to manage call queue agent caller ID information
- available_queues_gen(person_id: str, org_id: str | None = None) AsyncGenerator[AgentQueue, None, None] [source]
Retrieve the list of the person’s available call queues and the associated Caller ID information
If the Agent is to enable queueCallerIdEnabled, they must choose which queue to use as the source for outgoing Caller ID. This API returns a list of Call Queues from which the person must select. If this setting is disabled or Agent does not belong to any queue this list will be empty.
This API requires a full admin or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
person_id (str) – Unique identifier for the person.
org_id (str) – organization id
- Returns:
yields person’s available call queues and the associated Caller ID information
- Return type:
Generator[AgentQueue, None, None]
- async available_queues(person_id: str, org_id: str | None = None) List[AgentQueue] [source]
Retrieve the list of the person’s available call queues and the associated Caller ID information
If the Agent is to enable queueCallerIdEnabled, they must choose which queue to use as the source for outgoing Caller ID. This API returns a list of Call Queues from which the person must select. If this setting is disabled or Agent does not belong to any queue this list will be empty.
This API requires a full admin or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
person_id (str) – Unique identifier for the person.
org_id (str) – organization id
- Returns:
yields person’s available call queues and the associated Caller ID information
- Return type:
Generator[AgentQueue, None, None]
- async read(person_id: str, org_id: str | None = None) QueueCallerId [source]
Retrieve a call queue agent’s Caller ID information
Each agent in the Call Queue will be able to set their outgoing Caller ID as either the Call Queue’s phone number or their own configured Caller ID. This API fetches the configured Caller ID for the agent in the system.
This API requires a full admin or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
person_id (str) – Unique identifier for the person.
org_id (str) – organization id
- Returns:
call queue agent’s Caller ID information
- Return type:
- async update(person_id: str, update: QueueCallerId, org_id: str | None = None)[source]
Modify a call queue agent’s Caller ID information
Each Agent in the Call Queue will be able to set their outgoing Caller ID as either the designated Call Queue’s phone number or their own configured Caller ID. This API modifies the configured Caller ID for the agent in the system.
This API requires a full or user administrator auth token with the spark-admin:telephony_config_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
update (QueueCallerId) – new settings
org_id (str) – organization id
- base = 'telephony/config/people'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAnnouncementApi(*, session: AsRestSession)[source]
Bases:
object
API for call queue Announcements
- list_gen(location_id: str, queue_id: str, org_id: str | None = None) AsyncGenerator[Announcement] [source]
- Parameters:
location_id –
queue_id –
org_id –
- Returns:
- async list(location_id: str, queue_id: str, org_id: str | None = None) List[Announcement] [source]
- Parameters:
location_id –
queue_id –
org_id –
- Returns:
- class wxc_sdk.as_api.AsApiChild(*, session: AsRestSession, base: str | None = None)[source]
Bases:
object
Base class for child APIs of
WebexSimpleApi
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAppServicesApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s app services settings
- feature = 'applications'
- async read(person_id: str, org_id: str | None = None) AppServicesSettings [source]
Retrieve a Person’s Application Services Settings
Application services let you determine the ringing behavior for calls made to people in certain scenarios. You can also specify which devices can download the Webex Calling app.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
privacy settings
- Return type:
Privacy
- async configure(person_id: str, settings: AppServicesSettings, org_id: str | None = None)[source]
Modify a Person’s Application Services Settings
Application services let you determine the ringing behavior for calls made to users in certain scenarios. You can also specify which devices users can download the Webex Calling app on.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
AppServicesSettings
) – settings for updateorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAttachmentActionsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Users create attachment actions by interacting with message attachments such as clicking on a submit button in a card.
- async details(action_id: str) AttachmentAction [source]
Shows details for a attachment action, by ID. Specify the attachment action ID in the id URI parameter.
- Parameters:
action_id (str) – A unique identifier for the attachment action.
- base = 'attachment/actions'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAuthCodesApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s outgoing permission authorization codes
- feature = 'outgoingPermission/authorizationCodes'
- async read(person_id: str, org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
Retrieve Authorization codes for a Workspace.
Authorization codes are used to bypass permissions.
This API requires a full or read-only administrator auth token with a scope of spark-admin:workspaces_read or a user auth token with spark:workspaces_read scope can be used to read workspace settings.
- Parameters:
person_id (str) – Unique identifier for the workspace.
org_id (str) – Workspace 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:
list of authorization codes
- Return type:
list of
AuthCode
- async delete_codes(person_id: str, access_codes: list[Union[str, wxc_sdk.common.AuthCode]], org_id: str | None = None)[source]
Modify Authorization codes for a workspace.
Authorization codes are used to bypass permissions.
This API requires a full or user administrator auth token with the spark-admin:workspaces_write scope or a user auth token with spark:workspaces_write scope can be used to update workspace settings.
- Parameters:
person_id (str) – Unique identifier for the workspace.
access_codes (list[str]) – authorization codes to remove
org_id (str) – Workspace 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.
- async create(person_id: str, code: str, description: str, org_id: str | None = None)[source]
Modify Authorization codes for a workspace.
Authorization codes are used to bypass permissions.
This API requires a full or user administrator auth token with the spark-admin:workspaces_write scope or a user auth token with spark:workspaces_write scope can be used to update workspace settings.
- Parameters:
person_id (str) – Unique identifier for the workspace.
code (str) – Indicates an authorization code.
description (str) – Indicates the description of the authorization code.
org_id (str) – Workspace 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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsAutoAttendantApi(session: AsRestSession)[source]
Bases:
AsApiChild
Auto attendant API
- forwarding: AsForwardingApi
- list_gen(org_id: str | None = None, location_id: str | None = None, name: str | None = None, phone_number: str | None = None, **params) AsyncGenerator[AutoAttendant, None, None] [source]
Read the List of Auto Attendants List all Auto Attendants for the organization.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – List auto attendants for this organization.
location_id (str) – Return the list of auto attendants for this location.
name (str) – Only return auto attendants with the matching name.
phone_number (str) – Only return auto attendants with the matching phone number.
- Returns:
yields
AutoAttendant
objects
- async list(org_id: str | None = None, location_id: str | None = None, name: str | None = None, phone_number: str | None = None, **params) List[AutoAttendant] [source]
Read the List of Auto Attendants List all Auto Attendants for the organization.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – List auto attendants for this organization.
location_id (str) – Return the list of auto attendants for this location.
name (str) – Only return auto attendants with the matching name.
phone_number (str) – Only return auto attendants with the matching phone number.
- Returns:
yields
AutoAttendant
objects
- async by_name(name: str, location_id: str | None = None, org_id: str | None = None) AutoAttendant | None [source]
Get auto attendant info by name
- Parameters:
location_id –
name –
org_id –
- Returns:
- async details(location_id: str, auto_attendant_id: str, org_id: str | None = None) AutoAttendant [source]
Get Details for an Auto Attendant Retrieve an Auto Attendant details.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Retrieving an auto attendant details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve an auto attendant details in this location.
auto_attendant_id (str) – Retrieve the auto attendant with the matching ID.
org_id (str) – Retrieve auto attendant details from this organization.
- Returns:
auto attendant details
- Return type:
AutoAttendant
- async create(location_id: str, settings: AutoAttendant, org_id: str | None = None) str [source]
Create an Auto Attendant Create new Auto Attendant for the given location.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Creating an auto attendant requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create the auto attendant for this location.
settings (
AutoAttendant
) – auto attendant settings for new auto attendantorg_id (str) – Create the auto attendant for this organization.
- Returns:
ID of the newly created auto attendant.
- Return type:
str
- async update(location_id: str, auto_attendant_id: str, settings: AutoAttendant, org_id: str | None = None)[source]
Update an Auto Attendant Update the designated Auto Attendant.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Updating an auto attendant requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this auto attendant exists.
auto_attendant_id (str) – Update an auto attendant with the matching ID.
settings (
AutoAttendant
) – auto attendant settings for the updateorg_id (str) – Create the auto attendant for this organization.
- async delete_auto_attendant(location_id: str, auto_attendant_id: str, org_id: str | None = None)[source]
elete the designated Auto Attendant.
Auto attendants play customized prompts and provide callers with menu options for routing their calls through your system.
Deleting an auto attendant requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete an auto attendant.
auto_attendant_id (str) – Delete the auto attendant with the matching ID.
org_id (str) – Delete the auto attendant from this organization.
- base = 'telephony/config/autoAttendants'
- class wxc_sdk.as_api.AsBargeApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s barge settings
- feature = 'bargeIn'
- async read(person_id: str, org_id: str | None = None) BargeSettings [source]
Retrieve a Person’s Barge In Settings
The Barge In feature enables you to use a Feature Access Code (FAC) to answer a call that was directed to another subscriber, or barge-in on the call if it was already answered. Barge In can be used across locations.
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 person to read their own settings.
- 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:
barge settings for specific user
- Return type:
- async configure(person_id: str, barge_settings: BargeSettings, org_id: str | None = None)[source]
Configure a Person’s Barge In Settings
The Barge In feature enables you to use a Feature Access Code (FAC) to answer a call that was directed to another subscriber, or barge-in on the call if it was already answered. Barge In can be used across locations.
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 person to update their own settings.
- Parameters:
person_id (str) – Unique identifier for the person.
barge_settings (BargeSettings) – new setting to be applied
org_id – 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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCQPolicyApi(session: AsRestSession)[source]
Bases:
object
- async holiday_service_details(location_id: str, queue_id: str, org_id: str | None = None) HolidayService [source]
Retrieve Call Queue Holiday Service details.
Configure the call queue to route calls differently during the holidays.
Retrieving call queue holiday service details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve settings for a call queue in this location.
queue_id (str) – Retrieve settings for the call queue with this identifier.
org_id (str) – Retrieve call queue settings from this organization.
- Returns:
Call Queue Holiday Service details
- Return type:
- async holiday_service_update(location_id: str, queue_id: str, update: HolidayService, org_id: str | None = None)[source]
Update the designated Call Queue Holiday Service.
Configure the call queue to route calls differently during the holidays.
Updating a call queue holiday service requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this call queue exists.
queue_id (str) – Update setting for the call queue with the matching ID.
update (HolidayService) – holiday service settings.
org_id (str) – Update call queue settings from this organisation.
- async night_service_detail(location_id: str, queue_id: str, org_id: str | None = None) NightService [source]
Retrieve Call Queue Night service details.
Configure the call queue to route calls differently during the hours when the queue is not in service. This is determined by a schedule that defines the business hours of the queue.
Retrieving call queue details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve settings for a call queue in this location.
queue_id (str) – Retrieve settings for the call queue night service with this identifier.
org_id (str) – Retrieve call queue night service settings from this organisation
- Returns:
Call Queue Night service details
- Return type:
- async night_service_update(location_id: str, queue_id: str, update: NightService, org_id: str | None = None)[source]
Update Call Queue Night Service details.
Configure the call queue to route calls differently during the hours when the queue is not in service. This is determined by a schedule that defines the business hours of the queue.
Retrieving call queue night service details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – update settings for a call queue in this location.
queue_id (str) – update settings for the call queue night service with this identifier.
update (NightService) – new night service settings
org_id (str) – update call queue night service settings from this organisation.
- async stranded_calls_details(location_id: str, queue_id: str, org_id: str | None = None) StrandedCalls [source]
Allow admin to view default/configured Stranded Calls settings.
Stranded-All agents logoff Policy: If the last agent staffing a queue “unjoins” the queue or signs out, then all calls in the queue become stranded. Stranded-Unavailable Policy: This policy allows for the configuration of the processing of calls that are in a staffed queue when all agents are unavailable.
Retrieving call queue Stranded Calls details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve settings for a call queue in this location.
queue_id (str) – Retrieve settings for the call queue with this identifier.
org_id (str) – Retrieve call queue settings from this organization.
- Returns:
Stranded Calls settings
- Return type:
- async stranded_calls_update(location_id: str, queue_id: str, update: StrandedCalls, org_id: str | None = None)[source]
Update the designated Call Stranded Calls Service.
Allow admin to modify configured Stranded Calls settings.
Updating a call queue stranded calls requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this call queue exists.
queue_id (str) – Update setting for the call queue with the matching ID.
update (StrandedCalls) – Call Stranded Calls settings
org_id (str) – Update call queue settings from this organisation.
- async forced_forward_details(location_id: str, queue_id: str, org_id: str | None = None) ForcedForward [source]
Retrieve Call Queue policy Forced Forward details.
This policy allows calls to be temporarily diverted to a configured destination.
Retrieving call queue Forced Forward details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id – Location in which this call queue exists.
queue_id – Retrieve setting for the call queue with the matching ID.
org_id – Retrieve call queue settings from this organisation.
- Returns:
Call Queue policy Forced Forward details.
- Return type:
- async forced_forward_update(location_id: str, queue_id: str, update: ForcedForward, org_id: str | None = None)[source]
Update the designated Forced Forward Service.
If the option is enabled, then incoming calls to the queue are forwarded to the configured destination. Calls that are already in the queue remain queued. The policy can be configured to play an announcement prior to proceeding with the forward.
Updating a call queue Forced Forward service requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this call queue exists.
queue_id (str) – Update setting for the call queue with the matching ID.
update (ForcedForward) – new call queue Forced Forward settings
org_id (str) – Update call queue settings from this organisation.
- class wxc_sdk.as_api.AsCallInterceptApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call intercept settings
- feature = 'intercept'
- async read(person_id: str, org_id: str | None = None) InterceptSetting [source]
Read Call Intercept Settings for a Person
Retrieves Person’s Call Intercept Settings
The intercept feature gracefully takes a person’s phone out of service, while providing callers with informative announcements and alternative routing options. Depending on the service configuration, none, some, or all incoming calls to the specified person are intercepted. Also depending on the service configuration, outgoing calls are intercepted or rerouted to another location.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
user’s call intercept settings
- Return type:
- async configure(person_id: str, intercept: InterceptSetting, org_id: str | None = None)[source]
Configure Call Intercept Settings for a Person
Configures a Person’s Call Intercept Settings
The intercept feature gracefully takes a person’s phone out of service, while providing callers with informative announcements and alternative routing options. Depending on the service configuration, none, some, or all incoming calls to the specified person are intercepted. Also depending on the service configuration, outgoing calls are intercepted or rerouted to another location.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
intercept (InterceptSetting) – new intercept settings
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.
- async greeting(person_id: str, content: BufferedReader | str, upload_as: str | None = None, org_id: str | None = None)[source]
Configure Call Intercept Greeting for a Person
Configure a Person’s Call Intercept Greeting by uploading a Waveform Audio File Format, .wav, encoded audio file.
Your request will need to be a multipart/form-data request rather than JSON, using the audio/wav Content-Type.
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 person to update their settings.
- Parameters:
person_id (str) – Unique identifier for the person.
content (Union[BufferedReader, str]) – the file to be uploaded, can be a path to a file or a buffered reader (opened file); if a reader referring to an open file is passed then make sure to open the file as binary b/c otherwise the content length might be calculated wrong
upload_as (str) – filename for the content. Only required if content is a reader; has to be a .wav file name.
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallParkApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Call Park API
- list_gen(location_id: str, order: Literal['ASC', 'DSC'] | None = None, name: str | None = None, org_id: str | None = None, **params) AsyncGenerator[CallPark, None, None] [source]
Read the List of Call Parks
List all Call Parks for the organization.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – Return the list of call parks for this location.
order (str) – Sort the list of call parks by name, either ASC or DSC. Default is ASC.
name (str) – Return the list of call parks that contains the given name. The maximum length is 80.
org_id (str) – List call parks for this organization.
- Returns:
yields
CallPark
objects
- async list(location_id: str, order: Literal['ASC', 'DSC'] | None = None, name: str | None = None, org_id: str | None = None, **params) List[CallPark] [source]
Read the List of Call Parks
List all Call Parks for the organization.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – Return the list of call parks for this location.
order (str) – Sort the list of call parks by name, either ASC or DSC. Default is ASC.
name (str) – Return the list of call parks that contains the given name. The maximum length is 80.
org_id (str) – List call parks for this organization.
- Returns:
yields
CallPark
objects
- async create(location_id: str, settings: CallPark, org_id: str | None = None) str [source]
Create a Call Park
Create new Call Parks for the given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Creating a call park requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – Create the call park for this location.
settings (
CallPark
) – settings for new call parkorg_id – Create the call park for this organization.
- Returns:
ID of the newly created call park.
- Return type:
str
- async delete_callpark(location_id: str, callpark_id: str, org_id: str | None = None)[source]
Delete a Call Park
Delete the designated Call Park.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Deleting a call park requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – Location from which to delete a call park.
callpark_id (str) – Delete the call park with the matching ID.
org_id (str) – Delete the call park from this organization.
- async details(location_id: str, callpark_id: str, org_id: str | None = None) CallPark [source]
Get Details for a Call Park
Retrieve Call Park details.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving call park details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – Retrieve settings for a call park in this location.
callpark_id (str) – Retrieve settings for a call park with the matching ID.
org_id (str) – Retrieve call park settings from this organization.
- Returns:
call park info
- Return type:
CallPark
- async update(location_id: str, callpark_id: str, settings: CallPark, org_id: str | None = None) str [source]
Update a Call Park
Update the designated Call Park.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Updating a call park requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Park ID will change upon modification of the Call Park name.
- Parameters:
location_id (str) – RLocation in which this call park exists.
callpark_id (str) – Update settings for a call park with the matching ID.
settings (
CallPark
) – updatesorg_id (str) – Update call park settings from this organization.
- available_agents_gen(location_id: str, call_park_name: str | None = None, name: str | None = None, phone_number: str | None = None, order: str | None = None, org_id: str | None = None) AsyncGenerator[PersonPlaceAgent, None, None] [source]
Get available agents from Call Parks Retrieve available agents from call parks for a given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving available agents from call parks requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available agents for this location.
call_park_name (str) – Only return available agents from call parks with the matching name.
name (str) – Only return available agents with the matching name.
phone_number (str) – Only return available agents with the matching primary number.
order (str) – Order the available agents according to the designated fields. Up to three vertical bar (|) separated sort order fields may be specified. Available sort fields: fname, lname, number and extension. The maximum supported sort order value is 3.
org_id (str) – Return the available agents for this organization.
- Returns:
yields
PersonPlaceCallPark
objects
- async available_agents(location_id: str, call_park_name: str | None = None, name: str | None = None, phone_number: str | None = None, order: str | None = None, org_id: str | None = None) List[PersonPlaceAgent] [source]
Get available agents from Call Parks Retrieve available agents from call parks for a given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving available agents from call parks requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available agents for this location.
call_park_name (str) – Only return available agents from call parks with the matching name.
name (str) – Only return available agents with the matching name.
phone_number (str) – Only return available agents with the matching primary number.
order (str) – Order the available agents according to the designated fields. Up to three vertical bar (|) separated sort order fields may be specified. Available sort fields: fname, lname, number and extension. The maximum supported sort order value is 3.
org_id (str) – Return the available agents for this organization.
- Returns:
yields
PersonPlaceCallPark
objects
- available_recalls_gen(location_id: str, name: str | None = None, order: str | None = None, org_id: str | None = None) AsyncGenerator[AvailableRecallHuntGroup, None, None] [source]
Get available recall hunt groups from Call Parks
Retrieve available recall hunt groups from call parks for a given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving available recall hunt groups from call parks requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available recall hunt groups for this location.
name (str) – Only return available recall hunt groups with the matching name.
order – Order the available recall hunt groups according to the designated fields. Available sort fields: lname.
order – str
org_id (str) – Return the available recall hunt groups for this organization.
- Returns:
yields
AvailableRecallHuntGroup
objects
- async available_recalls(location_id: str, name: str | None = None, order: str | None = None, org_id: str | None = None) List[AvailableRecallHuntGroup] [source]
Get available recall hunt groups from Call Parks
Retrieve available recall hunt groups from call parks for a given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving available recall hunt groups from call parks requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available recall hunt groups for this location.
name (str) – Only return available recall hunt groups with the matching name.
order – Order the available recall hunt groups according to the designated fields. Available sort fields: lname.
order – str
org_id (str) – Return the available recall hunt groups for this organization.
- Returns:
yields
AvailableRecallHuntGroup
objects
- async call_park_settings(location_id: str, org_id: str | None = None) LocationCallParkSettings [source]
Get Call Park Settings
Retrieve Call Park Settings from call parks for a given location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Retrieving settings from call parks requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the call park settings for this location.
org_id (str) – Return the call park settings for this organization.
- Returns:
- async update_call_park_settings(location_id: str, settings: LocationCallParkSettings, org_id: str | None = None)[source]
Update Call Park settings
Update Call Park settings for the designated location.
Call Park allows call recipients to place a call on hold so that it can be retrieved from another device.
Updating call park settings requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location for which call park settings will be updated.
settings (
LocationCallParkSettings
) – update settingsorg_id (str) – Update call park settings from this organization.
- base = 'telephony/config/callParks'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallPickupApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Call Pickup API
- list_gen(location_id: str, order: Literal['ASC', 'DSC'] | None = None, name: str | None = None, org_id: str | None = None, **params) AsyncGenerator[CallPickup, None, None] [source]
Read the List of Call Pickups
List all Call Pickups for the organization.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Retrieving this list requires a full, user, or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Return the list of call pickups for this location.
order (str) – Sort the list of call pickups by name, either ASC or DSC. Default is ASC.
name (str) – Return the list of call pickups that contains the given name. The maximum length is 80.
org_id (str) – List call pickups for this organization.
- Returns:
yields
CallPickup
objects
- async list(location_id: str, order: Literal['ASC', 'DSC'] | None = None, name: str | None = None, org_id: str | None = None, **params) List[CallPickup] [source]
Read the List of Call Pickups
List all Call Pickups for the organization.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Retrieving this list requires a full, user, or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Return the list of call pickups for this location.
order (str) – Sort the list of call pickups by name, either ASC or DSC. Default is ASC.
name (str) – Return the list of call pickups that contains the given name. The maximum length is 80.
org_id (str) – List call pickups for this organization.
- Returns:
yields
CallPickup
objects
- async create(location_id: str, settings: CallPickup, org_id: str | None = None) str [source]
Create a Call Pickup
Create new Call Pickups for the given location.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Creating a call pickup requires a full or user administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Create the call pickup for this location.
settings (
CallPickup
) – settings for new call pickuporg_id – Create the call pickup for this organization.
- Returns:
ID of the newly created call pickup.
- Return type:
str
- async delete_pickup(location_id: str, pickup_id: str, org_id: str | None = None)[source]
Delete a Call Pickup
Delete the designated Call Pickup.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Deleting a call pickup requires a full or user administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Location from which to delete a call pickup.
pickup_id (str) – Delete the call pickup with the matching ID.
org_id (str) – Delete the call pickup from this organization.
- async details(location_id: str, pickup_id: str, org_id: str | None = None) CallPickup [source]
Get Details for a Call Pickup
Retrieve Call Pickup details.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Retrieving call pickup details requires a full, user, or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Retrieve settings for a call pickup in this location.
pickup_id (str) – Retrieve settings for a call pickup with the matching ID.
org_id (str) – Retrieve call pickup settings from this organization.
- Returns:
call pickup info
- Return type:
CallPickup
- async update(location_id: str, pickup_id: str, settings: CallPickup, org_id: str | None = None) str [source]
Update a Call Pickup
Update the designated Call Pickup.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Updating a call pickup requires a full or user administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Call Pickup ID will change upon modification of the Call Pickup name.
- Parameters:
location_id (str) – Location in which this call pickup exists.
pickup_id (str) – Update settings for a call pickup with the matching ID.
settings (
CallPickup
) – updatesorg_id (str) – Update call pickup settings from this organization.
- available_agents_gen(location_id: str, call_pickup_name: str | None = None, name: str | None = None, phone_number: str | None = None, order: str | None = None, org_id: str | None = None) AsyncGenerator[PersonPlaceAgent, None, None] [source]
Get available agents from Call Pickups Retrieve available agents from call pickups for a given location.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Retrieving available agents from call pickups requires a full, user, or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available agents for this location.
call_pickup_name (str) – Only return available agents from call pickups with the matching name.
name (str) – Only return available agents with the matching name.
phone_number (str) – Only return available agents with the matching primary number.
order (str) – Order the available agents according to the designated fields. Up to three vertical bar (|) separated sort order fields may be specified. Available sort fields: fname, lname, number and extension. The maximum supported sort order value is 3.
org_id (str) – Return the available agents for this organization.
- Returns:
yields
PersonPlaceCallPark
objects
- async available_agents(location_id: str, call_pickup_name: str | None = None, name: str | None = None, phone_number: str | None = None, order: str | None = None, org_id: str | None = None) List[PersonPlaceAgent] [source]
Get available agents from Call Pickups Retrieve available agents from call pickups for a given location.
Call Pickup enables a user(agent) to answer any ringing line within their pickup group.
Retrieving available agents from call pickups requires a full, user, or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the available agents for this location.
call_pickup_name (str) – Only return available agents from call pickups with the matching name.
name (str) – Only return available agents with the matching name.
phone_number (str) – Only return available agents with the matching primary number.
order (str) – Order the available agents according to the designated fields. Up to three vertical bar (|) separated sort order fields may be specified. Available sort fields: fname, lname, number and extension. The maximum supported sort order value is 3.
org_id (str) – Return the available agents for this organization.
- Returns:
yields
PersonPlaceCallPark
objects
- base = 'telephony/config/callPickups'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallQueueApi(session: AsRestSession)[source]
Bases:
object
Call Queue APÍ
- forwarding: AsForwardingApi
- announcement: AsAnnouncementApi
- policy: AsCQPolicyApi
- list_gen(location_id: str | None = None, name: str | None = None, org_id: str | None = None, **params) AsyncGenerator[CallQueue, None, None] [source]
Read the List of Call Queues List all Call Queues for the organization.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned an internal extension, which can be dialed internally to reach users assigned to the call queue.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Only return call queues with matching location ID.
name (str) – Only return call queues with the matching name.
org_id (str) – List call queues for this organization
params (dict) – dict of additional parameters passed directly to endpoint
- Returns:
yields
CallQueue
objects
- async list(location_id: str | None = None, name: str | None = None, org_id: str | None = None, **params) List[CallQueue] [source]
Read the List of Call Queues List all Call Queues for the organization.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned an internal extension, which can be dialed internally to reach users assigned to the call queue.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Only return call queues with matching location ID.
name (str) – Only return call queues with the matching name.
org_id (str) – List call queues for this organization
params (dict) – dict of additional parameters passed directly to endpoint
- Returns:
yields
CallQueue
objects
- async by_name(name: str, location_id: str | None = None, org_id: str | None = None) CallQueue | None [source]
Get queue info by name
- Parameters:
location_id –
name –
org_id –
- Returns:
- async create(location_id: str, settings: CallQueue, org_id: str | None = None) str [source]
Create a Call Queue Create new Call Queues for the given location.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned an internal extension, which can be dialed internally to reach users assigned to the call queue.
Creating a call queue requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create the call queue for this location.
settings (
CallQueue
) – parameters for queue creation.org_id (str) – Create the call queue for this organization.
- Returns:
queue id
- Return type:
str
Example
settings = CallQueue(name=new_name, extension=extension, call_policies=CallQueueCallPolicies.default(), queue_settings=QueueSettings.default(queue_size=10), agents=[Agent(agent_id=user.person_id) for user in members]) # create new queue queue_id = api.telephony.callqueue.create(location_id=target_location.location_id, settings=settings)
- async delete_queue(location_id: str, queue_id: str, org_id: str | None = None)[source]
Delete a Call Queue Delete the designated Call Queue.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned an internal extension, which can be dialed internally to reach users assigned to the call queue.
Deleting a call queue requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete a call queue.
queue_id (str) – Delete the call queue with the matching ID.
org_id (str) – Delete the call queue from this organization.
- async details(location_id: str, queue_id: str, org_id: str | None = None) CallQueue [source]
Get Details for a Call Queue Retrieve Call Queue details.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned anvinternal extension, which can be dialed internally to reach users assigned to the call queue.
Retrieving call queue details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve settings for a call queue in this location
queue_id (str) – Retrieve settings for the call queue with this identifier.
org_id (str) – Retrieve call queue settings from this organization.
- Returns:
call queue details
- Return type:
CallQueue
- async update(location_id: str, queue_id: str, update: CallQueue, org_id: str | None = None)[source]
Update a Call Queue
Update the designated Call Queue.
Call queues temporarily hold calls in the cloud when all agents, which can be users or agents, assigned to receive calls from the queue are unavailable. Queued calls are routed to an available agent when not on an active call. Each call queue is assigned a Lead Number, which is a telephone number outside callers can dial to reach users assigned to the call queue. Call queues are also assigned an internal extension, which can be dialed internally to reach users assigned to the call queue.
Updating a call queue requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this call queue exists.
queue_id (str) – Update setting for the call queue with the matching ID.
update (
CallQueue
) – updatesorg_id – Update call queue settings from this organization.
Examples:
api = WebexSimpleApi() # shortcut cq = api.telephony.callqueue # disable a call queue update = CallQueue(enabled=False) cq.update(location_id=..., queue_id=..., update=update) # set the call routing policy to SIMULTANEOUS update = CallQueue(call_policies=CallPolicies(policy=Policy.simultaneous)) cq.update(location_id=..., queue_id=..., update=update) # don't bounce calls after the set number of rings. update = CallQueue( call_policies=CallPolicies( call_bounce=CallBounce( enabled=False))) cq.update(location_id=..., queue_id=..., update=update)
Alternatively you can also read call queue details, update them in place and then call update().
details = cq.details(location_id=..., queue_id=...) details.call_policies.call_bounce.agent_unavailable_enabled=False details.call_policies.call_bounce.on_hold_enabled=False cq.update(location_id=..., queue_id=..., update=details)
- class wxc_sdk.as_api.AsCallRecordingApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call recording settings
- feature = 'callRecording'
- async read(person_id: str, org_id: str | None = None) CallRecordingSetting [source]
Read Call Recording Settings for a Person
Retrieve a Person’s Call Recording Settings
The Call Recording feature provides a hosted mechanism to record the calls placed and received on the Carrier platform for replay and archival. This feature is helpful for quality assurance, security, training, and more.
This API requires a full or user administrator auth token with the spark-admin:people_write 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.
- async configure(person_id: str, recording: CallRecordingSetting, org_id: str | None = None)[source]
Configure Call Recording Settings for a Person
Configure a Person’s Call Recording Settings
The Call Recording feature provides a hosted mechanism to record the calls placed and received on the Carrier platform for replay and archival. This feature is helpful for quality assurance, security, training, and more.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
recording (CallRecordingSetting) – the new recording settings
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallWaitingApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call waiting settings
- feature = 'callWaiting'
- async read(person_id: str, org_id: str | None = None) bool [source]
Read Call Waiting Settings for a Person
Retrieve a Person’s Call Waiting Settings
With this feature, a person can place an active call on hold and answer an incoming call. When enabled, while you are on an active call, a tone alerts you of an incoming call and you can choose to answer or ignore the call.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
call waiting setting
- Return type:
bool
- async configure(person_id: str, enabled: bool, org_id: str | None = None)[source]
Configure Call Waiting Settings for a Person
Configure a Person’s Call Waiting Settings
With this feature, a person can place an active call on hold and answer an incoming call. When enabled, while you are on an active call, a tone alerts you of an incoming call and you can choose to answer or ignore the call.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
enabled (bool) – true if the Call Waiting feature is enabled.
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallerIdApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s caller id settings
- feature = 'callerId'
- async read(person_id: str, org_id: str | None = None) CallerId [source]
Retrieve a Person’s Caller ID Settings
Caller ID settings control how a person’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 person to read their settings.
- 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.
- async configure(person_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 Person’s Caller ID Settings
Caller ID settings control how a person’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 person to update their own settings.
- 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.
selected (CallerIdSelectedType) – Which type of outgoing Caller ID will be used.
custom_number (str) – This value must be an assigned number from the person’s location.
first_name (str) – Person’s Caller ID first name. Characters of %, +, `, ” and Unicode characters are not allowed.
last_name (str) – Person’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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallingBehaviorApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s calling behavior settings
- feature = 'callingBehavior'
- async read(person_id: str, org_id: str | None = None) CallingBehavior [source]
Read Person’s Calling Behavior
Retrieves the calling behavior and UC Manager Profile settings for the person which includes overall calling behavior and calling UC Manager Profile ID.
Webex Calling Behavior controls which Webex telephony application is to be used.
An organization has an organization-wide default Calling Behavior that may be overridden for individual persons.
In addition, UC Manager Profiles are applicable if your organization uses Jabber in Team Messaging mode or Calling in Webex Teams (Unified CM).
The UC Manager Profile also has an organization-wide default and may be overridden for individual persons.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
calling behavior setting
- Return type:
- async configure(person_id: str, settings: CallingBehavior, org_id: str | None = None)[source]
Configure a Person’s Calling Behavior
Modifies the calling behavior settings for the person which includes overall calling behavior and UC Manager Profile ID.
Webex Calling Behavior controls which Webex telephony application is to be used.
An organization has an organization-wide default Calling Behavior that may be overridden for individual persons.
In addition, UC Manager Profiles are applicable if your organization uses Jabber in Team Messaging mode or Calling in Webex Teams (Unified CM).
The UC Manager Profile also has an organization-wide default and may be overridden for individual persons.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (CallingBehavior) – new settings
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallparkExtensionApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Call Park Extension API
- list_gen(extension: str | None = None, name: str | None = None, location_id: str | None = None, location_name: str | None = None, order: str | None = None, org_id: str | None = None, **params) AsyncGenerator[CallParkExtension, None, None] [source]
Read the List of Call Park Extensions
List all Call Park Extensions for the organization.
The Call Park service, enabled for all users by default, allows a user to park a call against an available user’s extension or to a Call Park Extension. Call Park Extensions are extensions defined within the Call Park service for holding parked calls.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
extension (str) – Only return call park extensions with the matching extension.
name (str) – Only return call park extensions with the matching name.
location_id (str) – Only return call park extensions with matching location ID.
location_name (str) – Only return call park extensions with matching location name.
order (str) – Order the available agents according to the designated fields. Available sort fields: groupName, callParkExtension, callParkExtensionName, callParkExtensionExternalId.
org_id (str) – List call park extensions for this organization.
params – additional parameters
- Returns:
yields
wxc_sdk.common.CallParkExtension
instances
- async list(extension: str | None = None, name: str | None = None, location_id: str | None = None, location_name: str | None = None, order: str | None = None, org_id: str | None = None, **params) List[CallParkExtension] [source]
Read the List of Call Park Extensions
List all Call Park Extensions for the organization.
The Call Park service, enabled for all users by default, allows a user to park a call against an available user’s extension or to a Call Park Extension. Call Park Extensions are extensions defined within the Call Park service for holding parked calls.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
extension (str) – Only return call park extensions with the matching extension.
name (str) – Only return call park extensions with the matching name.
location_id (str) – Only return call park extensions with matching location ID.
location_name (str) – Only return call park extensions with matching location name.
order (str) – Order the available agents according to the designated fields. Available sort fields: groupName, callParkExtension, callParkExtensionName, callParkExtensionExternalId.
org_id (str) – List call park extensions for this organization.
params – additional parameters
- Returns:
yields
wxc_sdk.common.CallParkExtension
instances
- async details(location_id: str, cpe_id: str, org_id: str | None = None) CallParkExtension [source]
Get Details for a Call Park Extension
Retrieve Call Park Extension details.
The Call Park service, enabled for all users by default, allows a user to park a call against an available user’s extension or to a Call Park Extension. Call Park Extensions are extensions defined within the Call Park service for holding parked calls.
Retrieving call park extension details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve details for a call park extension in this location.
cpe_id (str) – Retrieve details for a call park extension with the matching ID.
org_id (str) – Retrieve call park extension details from this organization
- Returns:
call park extension details
- Return type:
wxc_sdk.common.CallParkExtension
instance (only name and extension are set)
- async create(location_id: str, name: str, extension: str, org_id: str | None = None) str [source]
Create new Call Park Extensions for the given location. Call Park Extension enables a call recipient to park a call to an extension, so someone else within the same Organization can retrieve the parked call by dialing that extension. Call Park Extensions can be added as monitored lines by users’ Cisco phones, so users can park and retrieve calls by pressing the associated phone line key. Creating a call park extension requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create the call park extension for this location.
name (str) – Name for the call park extension. The maximum length is 30.
extension (str) – Unique extension which will be assigned to call park extension. The minimum length is 2, maximum length is 6.
org_id (str) – Create the call park extension for this organization.
- Returns:
id of the new call park extension
- Return type:
str
- async delete(location_id: str, cpe_id: str, org_id: str | None = None)[source]
Delete the designated Call Park Extension. Call Park Extension enables a call recipient to park a call to an extension, so someone else within the same Organization can retrieve the parked call by dialing that extension. Call Park Extensions can be added as monitored lines by users’ Cisco phones, so users can park and retrieve calls by pressing the associated phone line key. Deleting a call park extension requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete a call park extension.
cpe_id (str) – Delete the call park extension with the matching ID.
org_id (str) – Delete the call park extension from this organization.
- async update(location_id: str, cpe_id: str, name: str | None = None, extension: str | None = None, org_id: str | None = None)[source]
Update the designated Call Park Extension. Call Park Extension enables a call recipient to park a call to an extension, so someone else within the same Organization can retrieve the parked call by dialing that extension. Call Park Extensions can be added as monitored lines by users’ Cisco phones, so users can park and retrieve calls by pressing the associated phone line key. Updating a call park extension requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this call park extension exists.
cpe_id (str) – Update a call park extension with the matching ID.
name (str) – Name for the call park extension. The maximum length is 30.
extension (str) – Unique extension which will be assigned to call park extension. The minimum length is 2, maximum length is 6.
org_id (str) – Update a call park extension from this organization.
- base = 'telephony'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsCallsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- async dial(destination: str) DialResponse [source]
Initiate an outbound call to a specified destination. This is also commonly referred to as Click to Call or Click to Dial. Alerts on all the devices belonging to the user. When the user answers on one of these alerting devices, an outbound call is placed from that device to the destination.
- Parameters:
destination (str) – The destination to be dialed. The destination can be digits or a URI. Some examples for destination include: 1234, 2223334444, +12223334444, *73, tel:+12223334444, user@company.domain, sip:user@company.domain
- Returns:
Call id and call session id
- async answer(call_id: str)[source]
Answer an incoming call on the user’s primary device.
- Parameters:
call_id (str) – The call identifier of the call to be answered.
- async reject(call_id: str, action: RejectAction | None = None)[source]
Reject an unanswered incoming call.
- Parameters:
call_id (str) – The call identifier of the call to be rejected.
action – The rejection action to apply to the call. The busy action is applied if no specific action is provided.
- async hangup(call_id: str)[source]
Hangup a call. If used on an unanswered incoming call, the call is rejected and sent to busy.
- Parameters:
call_id (str) – The call identifier of the call to hangup.
- async hold(call_id: str)[source]
Hold a connected call.
- Parameters:
call_id (str) – The call identifier of the call to hold.
- async resume(call_id: str)[source]
Resume a held call.
- Parameters:
call_id (str) – The call identifier of the call to resume.
- async divert(call_id: str, destination: str | None = None, to_voicemail: bool | None = None)[source]
Divert a call to a destination or a user’s voicemail. This is also commonly referred to as Blind Transfer
- Parameters:
call_id (str) – The call identifier of the call to divert.
destination (str) – The destination to divert the call to. If toVoicemail is false, destination is required. The destination can be digits or a URI. Some examples for destination include: 1234, 2223334444, +12223334444, *73, tel:+12223334444, user@company.domain, sip:user@company.domain
to_voicemail (bool) – If set to true, the call is diverted to voicemail. If no destination is specified, the call is diverted to the user’s own voicemail. If a destination is specified, the call is diverted to the specified user’s voicemail.
- async transfer(call_id1: str | None = None, call_id2: str | None = None, destination: str | None = None)[source]
Transfer two calls together. Unanswered incoming calls cannot be transferred but can be diverted using the divert API. If the user has only two calls and wants to transfer them together, the callId1 and callId2 parameters are optional and when not provided the calls are automatically selected and transferred. If the user has more than two calls and wants to transfer two of them together, the callId1 and callId2 parameters are mandatory to specify which calls are being transferred. These are also commonly referred to as Attended Transfer, Consultative Transfer, or Supervised Transfer and will return a 204 response. If the user wants to transfer one call to a new destination but only when the destination responds, the callId1 and destination parameters are mandatory to specify the call being transferred and the destination. This is referred to as a Mute Transfer and is similar to the divert API with the difference of waiting for the destination to respond prior to transferring the call. If the destination does not respond, the call is not transferred. This will return a 201 response.
- Parameters:
call_id1 (str) – The call identifier of the first call to transfer. This parameter is mandatory if either call_id2 or destination is provided.
call_id2 – The call identifier of the first call to transfer. This parameter is mandatory if either callId2 or destination is provided.
destination (str) – The destination to be transferred to. The destination can be digits or a URI. Some examples for destination include: 1234, 2223334444, +12223334444, *73, tel:+12223334444, user@company.domain, sip:user@company.domain. This parameter is mandatory if call_id1 is provided and call_id2 is not provided.
- async park(call_id: str, destination: str | None = None, is_group_park: bool | None = None) ParkedAgainst [source]
Park a connected call. The number field in the response can be used as the destination for the retrieve command to retrieve the parked call.
- Parameters:
call_id (str) – The call identifier of the call to park.
destination (str) – Identifies where the call is to be parked. If not provided, the call is parked against the parking user. The destination can be digits or a URI. Some examples for destination include: 1234, 2223334444, +12223334444, *73, tel:+12223334444, user@company.domain, sip:user@company.domain
is_group_park (bool) – If set to true, the call is parked against an automatically selected member of the user’s call park group and the destination parameter is ignored.
- Returns:
The details of where the call has been parked.
- Return type:
ParkedAgainst
- async retrieve(destination: str) CallInfo [source]
- Parameters:
destination – Identifies where the call is parked. The number field from the park command response can be used as the destination for the retrieve command. If not provided, the call parked against the retrieving user is retrieved. The destination can be digits or a URI. Some examples for destination include: 1234, 2223334444, +12223334444, *73, tel:+12223334444, user@company.domain, sip:user@company.domain
- Returns:
call id and call session id of retreived call
- Return type:
CallInfo
- async start_recording(call_id: str)[source]
Start recording a call. Use of this API is only valid when the user’s call recording mode is set to “On Demand”.
- Parameters:
call_id (str) – The call identifier of the call to start recording.
- async stop_recording(call_id: str)[source]
Stop recording a call. Use of this API is only valid when a call is being recorded and the user’s call recording mode is set to “On Demand”.
- Parameters:
call_id (str) – The call identifier of the call to stop recording.
- async pause_recording(call_id: str)[source]
Pause recording on a call. Use of this API is only valid when a call is being recorded and the user’s call recording mode is set to “On Demand” or “Always with Pause/Resume”.
- Parameters:
call_id (str) – The call identifier of the call to pause recording.
- async resume_recording(call_id: str)[source]
Resume recording a call. Use of this API is only valid when a call’s recording is paused and the user’s call recording mode is set to “On Demand” or “Always with Pause/Resume”.
- Parameters:
call_id (str) – The call identifier of the call to resume recording.
- async transmit_dtmf(call_id: str, dtmf: str)[source]
Transmit DTMF digits to a call.
- Parameters:
call_id (str) – The call identifier of the call to hold.
dtmf – The DTMF digits to transmit. Each digit must be part of the following set: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, *, #, A, B, C, D]. A comma “,” may be included to indicate a pause between digits. For the value “1,234”, the DTMF 1 digit is initially sent. After a pause, the DTMF 2, 3, and 4 digits are sent successively.
- async push(call_id: str)[source]
Pushes a call from the assistant to the executive the call is associated with. Use of this API is only valid when the assistant’s call is associated with an executive.
- Parameters:
call_id (str) – The call identifier of the call to push.
- async pickup(target: str) CallInfo [source]
Picks up an incoming call to another user. A new call is initiated to perform the pickup in a similar manner to the dial command. When target is not present, the API pickups up a call from the user’s call pickup group. When target is present, the API pickups an incoming call from the specified target user.
- Parameters:
target (str) – Identifies the user to pickup an incoming call from. If not provided, an incoming call to the user’s call pickup group is picked up. The target can be digits or a URI. Some examples for target include: 1234, 2223334444, +12223334444, tel:+12223334444, user@company.domain, sip:user@company.domain
- Returns:
call info of picked up call
- Return type:
CallInfo
- async barge_in(target: str)[source]
Barge-in on another user’s answered call. A new call is initiated to perform the barge-in in a similar manner to the dial command.
- Parameters:
target (str) – Identifies the user to barge-in on. The target can be digits or a URI. Some examples for target include: 1234, 2223334444, +12223334444, tel:+12223334444, user@company.domain, sip:user@company.domain
- Returns:
call info of picked up call
- Return type:
CallInfo
- list_calls_gen() AsyncGenerator[TelephonyCall, None, None] [source]
Get the list of details for all active calls associated with the user.
- Returns:
yield
TelephonyCall
- async list_calls() List[TelephonyCall] [source]
Get the list of details for all active calls associated with the user.
- Returns:
yield
TelephonyCall
- async call_details(call_id: str) TelephonyCall [source]
Get the details of the specified active call for the user.
- Parameters:
call_id (str) – The call identifier of the call.
- Returns:
call details
- Return type:
TelephonyCall
- call_history_gen(history_type: str | HistoryType | None = None) AsyncGenerator[CallHistoryRecord, None, None] [source]
List Call History Get the list of call history records for the user. A maximum of 20 call history records per type (placed, missed, received) are returned.
- Parameters:
history_type (HistoryType or str) – The type of call history records to retrieve. If not specified, then all call history records are retrieved. Possible values: placed, missed, received
- Returns:
yields
CallHistoryRecord
objects
- async call_history(history_type: str | HistoryType | None = None) List[CallHistoryRecord] [source]
List Call History Get the list of call history records for the user. A maximum of 20 call history records per type (placed, missed, received) are returned.
- Parameters:
history_type (HistoryType or str) – The type of call history records to retrieve. If not specified, then all call history records are retrieved. Possible values: placed, missed, received
- Returns:
yields
CallHistoryRecord
objects
- base = 'telephony/calls'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsDetailedCDRApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
To retrieve Detailed Call History information, you must use a token with the spark-admin:calling_cdr_read scope. The authenticating user must be a read-only-admin or full-admin of the organization and have the administrator role “Webex Calling Detailed Call History API access” enabled.
Detailed Call History information is available 5 minutes after a call has ended and may be retrieved for up to 48 hours. For example, if a call ends at 9:46 am, the record for that call can be collected using the API from 9:51 am, and is available until 9:46 am two days later.
This API is rate-limited to one call every 5 minutes for a given organization ID.
- get_cdr_history_gen(start_time: datetime | None = None, end_time: datetime | None = None, locations: list[str] | None = None, **params) AsyncGenerator[CDR, None, None] [source]
Provides Webex Calling Detailed Call History data for your organization.
Results can be filtered with the startTime, endTime and locations request parameters. The startTime and endTime parameters specify the start and end of the time period for the Detailed Call History reports you wish to collect. The API will return all reports that were created between startTime and endTime.
- Parameters:
start_time – Time of the first report you wish to collect. (report time is the time the call finished). Note: The specified time must be between 5 minutes ago and 48 hours ago.
end_time – Time of the last report you wish to collect. Note: The specified time should be earlier than startTime and no earlier than 48 hours ago
locations – Names of the location (as shown in Control Hub). Up to 10 comma-separated locations can be provided. Allows you to query reports by location.
params – additional arguments
- Returns:
- async get_cdr_history(start_time: datetime | None = None, end_time: datetime | None = None, locations: list[str] | None = None, **params) List[CDR] [source]
Provides Webex Calling Detailed Call History data for your organization.
Results can be filtered with the startTime, endTime and locations request parameters. The startTime and endTime parameters specify the start and end of the time period for the Detailed Call History reports you wish to collect. The API will return all reports that were created between startTime and endTime.
- Parameters:
start_time – Time of the first report you wish to collect. (report time is the time the call finished). Note: The specified time must be between 5 minutes ago and 48 hours ago.
end_time – Time of the last report you wish to collect. Note: The specified time should be earlier than startTime and no earlier than 48 hours ago
locations – Names of the location (as shown in Control Hub). Up to 10 comma-separated locations can be provided. Allows you to query reports by location.
params – additional arguments
- Returns:
- base = 'devices'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsDeviceSettingsJobsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for jobs to update device settings at the location and organization level
- async change(location_id: str | None, customization: DeviceCustomization, org_id: str | None = None) StartJobResponse [source]
Change device settings across organization or locations jobs.
Performs bulk and asynchronous processing for all types of device settings initiated by organization and system admins in a stateful persistent manner. This job will modify the requested device settings across all the devices. Whenever a location ID is specified in the request, it will modify the requested device settings only for the devices that are part of the provided location within an organization.
Returns a unique job ID which can then be utilized further to retrieve status and errors for the same.
Only one job per customer can be running at any given time within the same organization. An attempt to run multiple jobs at the same time will result in a 409 error response.
Running a job requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location within an organization where changes of device settings will be applied to all the devices within it.
customization (DeviceCustomization) – customization. Atttribute custom_enabled Indicates if all the devices within this location will be customized with new requested customizations(if set to true) or will be overridden with the one at organization level (if set to false or any other value). This field has no effect when the job is being triggered at organization level.
org_id (str) – Apply change device settings for all the devices under this organization.
- Returns:
information about the created job
- Return type:
- list_gen(org_id: str | None = None, **params) AsyncGenerator[StartJobResponse, None, None] [source]
List change device settings jobs.
Lists all the jobs for jobType calldevicesettings for the given organization in order of most recent one to oldest one irrespective of its status.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of ‘calldevicesettings’ jobs for this organization.
params – optional parameters
- Returns:
Generator of
StartJobResponse
instances
- async list(org_id: str | None = None, **params) List[StartJobResponse] [source]
List change device settings jobs.
Lists all the jobs for jobType calldevicesettings for the given organization in order of most recent one to oldest one irrespective of its status.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of ‘calldevicesettings’ jobs for this organization.
params – optional parameters
- Returns:
Generator of
StartJobResponse
instances
- async get_status(job_id: str, org_id: str | None = None) StartJobResponse [source]
Get change device settings job status.
Provides details of the job with jobId of jobType calldevicesettings.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve job details for this jobId.
org_id (str) – Retrieve job details for this org
- Returns:
job details
- Return type:
- job_errors_gen(job_id: str, org_id: str | None = None) AsyncGenerator[JobErrorItem, None, None] [source]
List change device settings job errors.
Lists all error details of the job with jobId of jobType calldevicesettings.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id – Retrieve job details for this jobId.
org_id – Retrieve list of jobs for this organization.
- Returns:
- async job_errors(job_id: str, org_id: str | None = None) List[JobErrorItem] [source]
List change device settings job errors.
Lists all error details of the job with jobId of jobType calldevicesettings.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id – Retrieve job details for this jobId.
org_id – Retrieve list of jobs for this organization.
- Returns:
- base = 'telephony/config/jobs/devices/callDeviceSettings'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsDevicesApi(*, session: AsRestSession)[source]
Bases:
AsApiChild
Devices represent cloud-registered Webex RoomOS devices. Devices may be associated with Workspaces.
Searching and viewing details for your devices requires an auth token with the spark:devices_read scope. Updating or deleting your devices requires an auth token with the spark:devices_write scope. Viewing the list of all devices in an organization requires an administrator auth token with the spark-admin:devices_read scope. Adding, updating, or deleting all devices in an organization requires an administrator auth token with the spark-admin:devices_write scope. Generating an activation code requires an auth token with the identity:placeonetimepassword_create scope.
- settings_jobs: AsDeviceSettingsJobsApi
device jobs Api
- list_gen(person_id: str | None = None, workspace_id: str | None = None, display_name: str | None = None, product: str | None = None, product_type: str | None = None, tag: str | None = None, connection_status: str | None = None, serial: str | None = None, software: str | None = None, upgrade_channel: str | None = None, error_code: str | None = None, capability: str | None = None, permission: str | None = None, org_id: str | None = None, **params) AsyncGenerator[Device, None, None] [source]
List Devices
Lists all active Webex devices associated with the authenticated user, such as devices activated in personal mode. Administrators can list all devices within an organization.
- Parameters:
person_id (str) – List devices by person ID.
workspace_id (str) – List devices by workspace ID.
display_name (str) – List devices with this display name.
product (str) – List devices with this product name.
product_type (str) – List devices with this type.
tag (str separating the tag values or adding several tag parameters.) – List devices which have a tag. Searching for multiple tags (logical AND) can be done by comma
connection_status (str) – List devices with this connection statu
serial (str) – List devices with this serial number.
software (str) – List devices with this software version.
upgrade_channel (str) – List devices with this upgrade channel.
error_code (str) – List devices with this error code.
capability (str) – List devices with this capability.
permission (str) – List devices with this permission.
org_id (str) – List devices in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
Generator yielding
Device
instances
- async list(person_id: str | None = None, workspace_id: str | None = None, display_name: str | None = None, product: str | None = None, product_type: str | None = None, tag: str | None = None, connection_status: str | None = None, serial: str | None = None, software: str | None = None, upgrade_channel: str | None = None, error_code: str | None = None, capability: str | None = None, permission: str | None = None, org_id: str | None = None, **params) List[Device] [source]
List Devices
Lists all active Webex devices associated with the authenticated user, such as devices activated in personal mode. Administrators can list all devices within an organization.
- Parameters:
person_id (str) – List devices by person ID.
workspace_id (str) – List devices by workspace ID.
display_name (str) – List devices with this display name.
product (str) – List devices with this product name.
product_type (str) – List devices with this type.
tag (str separating the tag values or adding several tag parameters.) – List devices which have a tag. Searching for multiple tags (logical AND) can be done by comma
connection_status (str) – List devices with this connection statu
serial (str) – List devices with this serial number.
software (str) – List devices with this software version.
upgrade_channel (str) – List devices with this upgrade channel.
error_code (str) – List devices with this error code.
capability (str) – List devices with this capability.
permission (str) – List devices with this permission.
org_id (str) – List devices in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
Generator yielding
Device
instances
- async details(device_id: str, org_id: str | None = None) Device [source]
Get Device Details Shows details for a device, by ID.
Specify the device ID in the deviceId parameter in the URI.
- Parameters:
device_id (str) – A unique identifier for the device.
org_id (str) –
- Returns:
Device details
- Return type:
- async delete(device_id: str, org_id: str | None = None)[source]
Delete a Device
Deletes a device, by ID.
Specify the device ID in the deviceId parameter in the URI.
- Parameters:
device_id (str) – A unique identifier for the device.
org_id (str) –
- async modify_device_tags(device_id: str, op: TagOp, value: List[str], org_id: str | None = None) Device [source]
Modify Device Tags
Update requests use JSON Patch syntax.
- async activation_code(workspace_id: str, org_id: str | None = None) ActivationCodeResponse [source]
Create a Device Activation Code
Generate an activation code for a device in a specific workspace by workspaceId. Currently, activation codes may only be generated for shared workspaces–personal mode is not supported.
- Parameters:
workspace_id – The workspaceId of the workspace where the device will be activated.
org_id –
- Returns:
activation code and expiry time
- Return type:
- base = 'devices'
- class wxc_sdk.as_api.AsDialPlanApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- list_gen(dial_plan_name: str | None = None, route_group_name: str | None = None, trunk_name: str | None = None, order: str | None = None, org_id: str | None = None, **params) AsyncGenerator[DialPlan, None, None] [source]
List all Dial Plans for the organization.
Dial plans route calls to on-premises destinations by use of the trunks or route groups with which the dial plan is associated. Multiple dial patterns can be defined as part of your dial plan. Dial plans are configured globally for an enterprise and apply to all users, regardless of location.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
dial_plan_name (str) – Return the list of dial plans matching the dial plan name.
route_group_name (str) – Return the list of dial plans matching the route group name.
trunk_name (str) – Return the list of dial plans matching the trunk name.
order (str) – Order the dial plans according to the designated fields. Available sort fields: name, routeName, routeType. Sort order is ascending by default
org_id (str) – List dial plans for this organization.
- Returns:
- async list(dial_plan_name: str | None = None, route_group_name: str | None = None, trunk_name: str | None = None, order: str | None = None, org_id: str | None = None, **params) List[DialPlan] [source]
List all Dial Plans for the organization.
Dial plans route calls to on-premises destinations by use of the trunks or route groups with which the dial plan is associated. Multiple dial patterns can be defined as part of your dial plan. Dial plans are configured globally for an enterprise and apply to all users, regardless of location.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
dial_plan_name (str) – Return the list of dial plans matching the dial plan name.
route_group_name (str) – Return the list of dial plans matching the route group name.
trunk_name (str) – Return the list of dial plans matching the trunk name.
order (str) – Order the dial plans according to the designated fields. Available sort fields: name, routeName, routeType. Sort order is ascending by default
org_id (str) – List dial plans for this organization.
- Returns:
- async create(name: str, route_id: str, route_type: RouteType, dial_patterns: List[str] | None = None, org_id: str | None = None) CreateResponse [source]
Create a Dial Plan for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Creating a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
name (str) – A unique name for the dial plan.
route_id (str) – ID of route type associated with the dial plan.
route_type (
wxc_sdk.common.RouteType
) – Route Type associated with the dial plan.dial_patterns (list[str]) – An Array of dial patterns
org_id (str) – Organization to which dial plan belongs.
- Returns:
result of dial plan creation
- Return type:
CreateResponse
- async details(dial_plan_id: str, org_id: str | None = None) DialPlan [source]
Get a Dial Plan for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Retrieving a dial plan requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
dial_plan_id (str) – ID of the dial plan.
org_id (str) – Organization to which dial plan belongs.
- Returns:
dial plan details
- Return type:
DialPlan
- async update(update: DialPlan, org_id: str | None = None)[source]
Modify a Dial Plan for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Modifying a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
update – DialPlan objects with updated settings. Only name, route_id and route_type are considered. All three need to be set
org_id (str) – Organization to which dial plan belongs.
- async delete_dial_plan(dial_plan_id: str, org_id: str | None = None)[source]
Delete a Dial Plan for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Deleting a dial plan requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
dial_plan_id (str) – ID of the dial plan.
org_id (str) – Organization to which dial plan belongs.
- patterns_gen(dial_plan_id: str, org_id: str | None = None, dial_pattern: str | None = None, **params) AsyncGenerator[str, None, None] [source]
List all Dial Patterns for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
dial_plan_id (str) – ID of the dial plan.
org_id (str) – List dial patterns associated with a dial plan.
dial_pattern – An enterprise dial pattern is represented by a sequence of digits (1-9), followed by optional wildcard characters. Valid wildcard characters are ! (matches any sequence of digits) and X (matches a single digit, 0-9). The ! wildcard can only occur once at the end and only in an E.164 pattern
- Returns:
list of patterns
- Return type:
list[str]
- async patterns(dial_plan_id: str, org_id: str | None = None, dial_pattern: str | None = None, **params) List[str] [source]
List all Dial Patterns for the organization.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
dial_plan_id (str) – ID of the dial plan.
org_id (str) – List dial patterns associated with a dial plan.
dial_pattern – An enterprise dial pattern is represented by a sequence of digits (1-9), followed by optional wildcard characters. Valid wildcard characters are ! (matches any sequence of digits) and X (matches a single digit, 0-9). The ! wildcard can only occur once at the end and only in an E.164 pattern
- Returns:
list of patterns
- Return type:
list[str]
- async modify_patterns(dial_plan_id: str, dial_patterns: List[PatternAndAction], org_id: str | None = None)[source]
Modify dial patterns for the Dial Plan.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Modifying a dial pattern requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
dial_plan_id (str) – ID of the dial plan being modified.
dial_patterns (
PatternAndAction
) – Array of dial patterns to add or delete. Dial Pattern that is not present in the request is not modified.org_id (str) – Organization to which dial plan belongs.
- async delete_all_patterns(dial_plan_id: str, org_id: str | None = None)[source]
Delete all dial patterns from the Dial Plan.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Deleting dial pattern requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
dial_plan_id (str) – ID of the dial plan being modified.
org_id (str) – Organization to which dial plan belongs.
- base = 'telephony/config/premisePstn/dialPlans'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsDndApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s DND settings
- feature = 'doNotDisturb'
- async read(person_id: str, org_id: str | None = None) DND [source]
Read Do Not Disturb Settings for a Person Retrieve a Person’s Do Not Disturb Settings
When enabled, this feature will give all incoming calls the busy treatment. Optionally, you can enable a Ring Reminder to play a brief tone on your desktop phone when you receive incoming 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 person to read their settings. :param person_id: Unique identifier for the person. :type person_id: str :param org_id: 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. :type org_id: str :return:
- async configure(person_id: str, dnd_settings: DND, org_id: str | None = None)[source]
Configure Do Not Disturb Settings for a Person Configure a Person’s Do Not Disturb Settings
When enabled, this feature will give all incoming calls the busy treatment. Optionally, you can enable a Ring Reminder to play a brief tone on your desktop phone when you receive incoming 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 person to update their settings.
- Parameters:
person_id (str) – Unique identifier for the person.
dnd_settings (DND) – new setting to be applied
org_id – 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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsEventsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Events are generated when actions take place within Webex, such as when someone creates or deletes a message. The Events API can only be used by a Compliance Officer with an API access token that contains the spark-compliance:events_read scope. See the Compliance Guide for more information.
- list_gen(resource: EventResource | None = None, type_: EventType | None = None, actor_id: str | None = None, from_: datetime | None = None, to_: datetime | None = None, **params) AsyncGenerator[ComplianceEvent, None, None] [source]
List events in your organization. Several query parameters are available to filter the events returned in the response. Long result sets will be split into pages.
- Parameters:
resource (EventResource) – List events with a specific resource type.
type (EventType) – List events with a specific event type.
actor_id (str) – List events performed by this person, by person ID.
from (str) – List events which occurred after a specific date and time.
to (str) – List events which occurred before a specific date and time. If unspecified, or set to a time in the future, lists events up to the present.
- async list(resource: EventResource | None = None, type_: EventType | None = None, actor_id: str | None = None, from_: datetime | None = None, to_: datetime | None = None, **params) List[ComplianceEvent] [source]
List events in your organization. Several query parameters are available to filter the events returned in the response. Long result sets will be split into pages.
- Parameters:
resource (EventResource) – List events with a specific resource type.
type (EventType) – List events with a specific event type.
actor_id (str) – List events performed by this person, by person ID.
from (str) – List events which occurred after a specific date and time.
to (str) – List events which occurred before a specific date and time. If unspecified, or set to a time in the future, lists events up to the present.
- async details(event_id: str) ComplianceEvent [source]
Shows details for an event, by event ID. Specify the event ID in the eventId parameter in the URI.
- Parameters:
event_id (str) – The unique identifier for the event.
- base = 'events'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsExecAssistantApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s exec assistant settings
- feature = 'executiveAssistant'
- async read(person_id: str, org_id: str | None = None) ExecAssistantType [source]
Retrieve Executive Assistant Settings for a Person
Retrieve the executive assistant settings for the specified personId.
People with the executive service enabled, can select from a pool of assistants who have been assigned the executive assistant service and who can answer or place calls on their behalf. Executive assistants can set the call forward destination and join or leave an executive’s pool.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
exec assistant setting
- Return type:
ExecAssistantType
- async configure(person_id: str, setting: ExecAssistantType, org_id: str | None = None)[source]
Modify Executive Assistant Settings for a Person
Modify the executive assistant settings for the specified personId.
People with the executive service enabled, can select from a pool of assistants who have been assigned the executive assistant service and who can answer or place calls on their behalf. Executive assistants can set the call forward destination and join or leave an executive’s pool.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
setting (
ExecAssistantType
) – New exex assistant settingsorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsForwardingApi(session: AsRestSession, feature_selector: FeatureSelector)[source]
Bases:
object
API for forwarding settings on call queues, hunt groups, and auto attendants
- async settings(location_id: str, feature_id: str, org_id: str | None = None) CallForwarding [source]
Retrieve Call Forwarding settings for the designated feature including the list of call forwarding rules.
- Parameters:
location_id (str) – Location in which this feature exists.
feature_id (str) – Retrieve the call forwarding settings for this entity
org_id (str) – Retrieve call forwarding settings from this organization.
- Returns:
call forwarding settings
- Return type:
class:CallForwarding
- async update(location_id: str, feature_id: str, forwarding: CallForwarding, org_id: str | None = None)[source]
Update Call Forwarding Settings for a feature
Update Call Forwarding settings for the designated feature.
Updating call forwarding settings for a feature requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location in which this feature exists.
feature_id (str) – Update call forwarding settings for this feature.
forwarding (
CallForwarding
) – Forwarding settingsorg_id (str) – Update feature forwarding settings from this organization.
- async create_call_forwarding_rule(location_id: str, feature_id: str, forwarding_rule: ForwardingRuleDetails, org_id: str | None = None) str [source]
Create a Selective Call Forwarding Rule feature
A selective call forwarding rule for feature to be forwarded or not forwarded to the designated number, based on the defined criteria.
Note that the list of existing call forward rules is available feature’s call forwarding settings. :param location_id: Location in which the call queue exists. :type location_id: str :param feature_id: Create the rule for this feature :type feature_id: str :param forwarding_rule: details of rule to be created :type forwarding_rule:
ForwardingRuleDetails
:param org_id: Create the feature forwarding rule for this organization. :type org_id: str :return: forwarding rule id :rtype; str
- async call_forwarding_rule(location_id: str, feature_id: str, rule_id: str, org_id: str | None = None) ForwardingRuleDetails [source]
Retrieve a Selective Call Forwarding Rule’s settings for the designated Call Queue.
A selective call forwarding rule for feature allows calls to be forwarded or not forwarded to the designated number, based on the defined criteria.
Note that the list of existing call forward rules is available in the feature’s call forwarding settings. :param location_id: Location in which the feature exists. :type location_id: stre :param feature_id: Retrieve setting for a rule for this feature. :type feature_id: str :param rule_id: feature rule you are retrieving settings for. :type rule_id: str :param org_id: Retrieve feature forwarding settings from this organization. :type org_id: str :return: call forwarding rule details :rtype:
ForwardingRuleDetails
- async update_call_forwarding_rule(location_id: str, feature_id: str, rule_id: str, forwarding_rule: ForwardingRuleDetails, org_id: str | None = None) str [source]
Update a Selective Call Forwarding Rule’s settings for the designated feature.
A selective call forwarding rule for feature allows calls to be forwarded or not forwarded to the designated number, based on the defined criteria.
Note that the list of existing call forward rules is available in the feature’s call forwarding settings.
NOTE: The Call Forwarding Rule ID will change upon modification of the Call Forwarding Rule name.
- Parameters:
location_id (str) – Location in which the feature exists.
feature_id (str) – Update settings for a rule for this feature.
rule_id (str) – feature you are updating settings for.
forwarding_rule (
ForwardingRuleDetails
) – forwarding rule details for updateorg_id (str) – Update feature rule settings for this organization.
- Returns:
new call forwarding rule id
- Return type:
str
- async delete_call_forwarding_rule(location_id: str, feature_id: str, rule_id: str, org_id: str | None = None)[source]
Delete a Selective Call Forwarding Rule for the designated feature.
A selective call forwarding rule for a feature allows calls to be forwarded or not forwarded to the designated number, based on the defined criteria.
Note that the list of existing call forward rules is available in the feature’s call forwarding settings.
- class wxc_sdk.as_api.AsGroupsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- list_gen(include_members: bool | None = None, attributes: str | None = None, sort_by: str | None = None, sort_order: str | None = None, list_filter: str | None = None, org_id: str | None = None, **params) AsyncGenerator[Group, None, None] [source]
List groups
- Parameters:
include_members (bool) – Include members in list response
attributes (str) – comma separated list of attributes to return
sort_by (str) – attribute to sort by
sort_order (str) – sort order, ascending or descending
org_id (str) – organisation ID
list_filter (str) – filter expression. Example: displayName eq “test”
params –
- Returns:
generator of
Group
objects
- async list(include_members: bool | None = None, attributes: str | None = None, sort_by: str | None = None, sort_order: str | None = None, list_filter: str | None = None, org_id: str | None = None, **params) List[Group] [source]
List groups
- Parameters:
include_members (bool) – Include members in list response
attributes (str) – comma separated list of attributes to return
sort_by (str) – attribute to sort by
sort_order (str) – sort order, ascending or descending
org_id (str) – organisation ID
list_filter (str) – filter expression. Example: displayName eq “test”
params –
- Returns:
generator of
Group
objects
- async create(settings: Group) Group [source]
Create a new group using the provided settings. Only display_name is mandatory
- Parameters:
settings (Group) – settings for new group
- Returns:
new group
- Return type:
Group
- async details(group_id: str, include_members: bool | None = None) Group [source]
Get group details
- Parameters:
group_id (str) – group id
include_members (bool) – return members in response
- Returns:
group details
- Return type:
- members_gen(group_id: str, **params) AsyncGenerator[GroupMember, None, None] [source]
Query members of a group
- Parameters:
group_id (str) – group id
params –
- Returns:
generator of
GroupMember
instances
- async members(group_id: str, **params) List[GroupMember] [source]
Query members of a group
- Parameters:
group_id (str) – group id
params –
- Returns:
generator of
GroupMember
instances
- async update(group_id: str, settings: Group | None = None, remove_all: bool | None = None) Group [source]
update group information.
Options: change displayName, add new members, remove some or all members, replace all members
- Parameters:
group_id –
settings –
remove_all –
- Returns:
- base = 'groups'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsHotelingApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s hoteling settings
- feature = 'hoteling'
- async read(person_id: str, org_id: str | None = None) bool [source]
Read Hoteling Settings for a Person
Retrieve a person’s hoteling settings.
As an administrator, you can enable hoteling for people so that their phone profile (phone number, features, and calling plan) is temporarily loaded onto a shared (host) phone.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
hoteling setting
- Return type:
bool
- async configure(person_id: str, enabled: bool, org_id: str | None = None)[source]
Configure Hoteling Settings for a Person
Configure a person’s hoteling settings.
As an administrator, you can enable hoteling for people so that their phone profile (phone number, features, and calling plan) is temporarily loaded onto a shared (host) phone.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
enabled (bool) – When true, allow this person to connect to a Hoteling host device.
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsHuntGroupApi(session: AsRestSession)[source]
Bases:
AsApiChild
Hunt Group API
- forwarding: AsForwardingApi
- list_gen(org_id: str | None = None, location_id: str | None = None, name: str | None = None, phone_number: str | None = None, **params) AsyncGenerator[HuntGroup, None, None] [source]
Read the List of Hunt Groups
List all calling Hunt Groups for the organization.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id – List hunt groups for this organization.
location_id – Only return hunt groups with matching location ID.
name – Only return hunt groups with the matching name.
phone_number – Only return hunt groups with the matching primary phone number or extension.
- Returns:
yields
HuntGroup
instances
- async list(org_id: str | None = None, location_id: str | None = None, name: str | None = None, phone_number: str | None = None, **params) List[HuntGroup] [source]
Read the List of Hunt Groups
List all calling Hunt Groups for the organization.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id – List hunt groups for this organization.
location_id – Only return hunt groups with matching location ID.
name – Only return hunt groups with the matching name.
phone_number – Only return hunt groups with the matching primary phone number or extension.
- Returns:
yields
HuntGroup
instances
- async by_name(name: str, location_id: str | None = None, org_id: str | None = None) HuntGroup | None [source]
Get hunt group info by name :param location_id: :param name: :param org_id: :return:
- async create(location_id: str, settings: HuntGroup, org_id: str | None = None) str [source]
Create a Hunt Group
Create new Hunt Groups for the given location.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Creating a hunt group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create the hunt group for the given location.
settings (
HuntGroup
) – hunt group detailsorg_id (str) – Create the hunt group for this organization.
- Returns:
ID of the newly created hunt group.
- Return type:
str
- async delete_huntgroup(location_id: str, huntgroup_id: str, org_id: str | None = None)[source]
Delete a Hunt Group
Delete the designated Hunt Group.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Deleting a hunt group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete a hunt group.
huntgroup_id (str) – Delete the hunt group with the matching ID.
org_id (str) – Delete the hunt group with the matching ID.
- async details(location_id: str, huntgroup_id: str, org_id: str | None = None) HuntGroup [source]
Get Details for a Hunt Group
Retrieve Hunt Group details.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Retrieving hunt group details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve settings for a hunt group in this location.
huntgroup_id (str) – Retrieve settings for the hunt group with this identifier.
org_id (str) – Retrieve hunt group settings from this organization.
- Returns:
hunt group details
- async update(location_id: str, huntgroup_id: str, update: HuntGroup, org_id: str | None = None)[source]
Update a Hunt Group
Update the designated Hunt Group.
Hunt groups can route incoming calls to a group of people or workspaces. You can even configure a pattern to route to a whole group.
Updating a hunt group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Update the hunt group for this location.
huntgroup_id (str) – Update setting for the hunt group with the matching ID.
update (
HuntGroup
) – hunt group settingsorg_id – Update hunt group settings from this organization.
- base = 'telephony/config/huntGroups'
- class wxc_sdk.as_api.AsIncomingPermissionsApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s incoming permissions settings
- feature = 'incomingPermission'
- async read(person_id: str, org_id: str | None = None) IncomingPermissions [source]
Read Incoming Permission Settings for a Person
Retrieve a Person’s Incoming Permission Settings
You can change the incoming calling permissions for a person if you want them to be different from your organization’s default.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
incoming permission settings for specific user
- Return type:
IncomingPermissions
- async configure(person_id: str, settings: IncomingPermissions, org_id: str | None = None)[source]
Configure a Person’s Barge In Settings
The Barge In feature enables you to use a Feature Access Code (FAC) to answer a call that was directed to another subscriber, or barge-in on the call if it was already answered. Barge In can be used across locations.
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 person to update their own settings.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
IncomingPermissions
) – new setting to be appliedorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsInternalDialingApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Internal dialing settings for location
- async read(location_id: str, org_id: str | None = None) InternalDialing [source]
Get current configuration for routing unknown extensions to the Premises as internal calls
If some users in a location are registered to a PBX, retrieve the setting to route unknown extensions (digits that match the extension length) to the PBX.
Retrieving the internal dialing configuration requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – location for which internal calling configuration is being requested
org_id (str) –
- Returns:
settings
- Return type:
InternalDialing
- async update(location_id: str, update: InternalDialing, org_id: str | None = None)[source]
Modify current configuration for routing unknown extensions to the Premises as internal calls
If some users in a location are registered to a PBX, enable the setting to route unknown extensions (digits that match the extension length) to the PBX.
Editing the internal dialing configuration requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – location for which internal calling configuration is being requested
update (
InternalDialing
) – new settingsorg_id (str) –
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsJobsApi(*, session: AsRestSession)[source]
Bases:
AsApiChild
Jobs API
- device_settings: AsDeviceSettingsJobsApi
API for device settings jobs
- manage_numbers: AsManageNumbersJobsApi
API for manage numbers jobs
- base = 'telephony/config/jobs'
- class wxc_sdk.as_api.AsLicensesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Licenses
An allowance for features and services that are provided to users on a Webex services subscription. Cisco and its partners manage the amount of licenses provided to administrators and users. This license resource can be accessed only by an admin.
- list_gen(org_id: str | None = None) AsyncGenerator[License, None, None] [source]
List all licenses for a given organization. If no org_id is specified, the default is the organization of the authenticated user.
Response properties that are not applicable to the license will not be present in the response.
- Parameters:
org_id (str) – List licenses for this organization.
- Returns:
yields
License
instances
- async list(org_id: str | None = None) List[License] [source]
List all licenses for a given organization. If no org_id is specified, the default is the organization of the authenticated user.
Response properties that are not applicable to the license will not be present in the response.
- Parameters:
org_id (str) – List licenses for this organization.
- Returns:
yields
License
instances
- async details(license_id) License [source]
Shows details for a license, by ID.
Response properties that are not applicable to the license will not be present in the response.
- Parameters:
license_id (str) – The unique identifier for the license.
- Returns:
license details
- Return type:
- base = 'licenses'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsLocationInterceptApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for location’s call intercept settings
- async read(location_id: str, org_id: str | None = None) InterceptSetting [source]
Get Location Intercept
Retrieve intercept location details for a customer location.
Intercept incoming or outgoing calls for persons in your organization. If this is enabled, calls are either routed to a designated number the person chooses, or to the person’s voicemail.
Retrieving intercept location details requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve intercept details for this location.
org_id (str) – Retrieve intercept location details for a customer location.
- Returns:
user’s call intercept settings
- Return type:
- async configure(location_id: str, settings: InterceptSetting, org_id: str | None = None)[source]
Put Location Intercept
Modifies the intercept location details for a customer location.
Intercept incoming or outgoing calls for users in your organization. If this is enabled, calls are either routed to a designated number the user chooses, or to the user’s voicemail.
Modifying the intercept location details requires a full, user administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Unique identifier for the person.
settings (InterceptSetting) – new intercept settings
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.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsLocationMoHApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Access codes API
- async read(location_id: str, org_id: str | None = None) LocationMoHSetting [source]
Get Music On Hold
Retrieve the location’s music on hold settings.
Location’s music on hold settings allows you to play music when a call is placed on hold or parked.
Retrieving location’s music on hold settings requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve access codes details for this location.
org_id (str) – Retrieve access codes details for a customer location in this organization
- Returns:
MoH settings
- Return type:
LocationMoHSetting
- async update(location_id: str, settings: LocationMoHSetting, org_id: str | None = None) LocationMoHSetting [source]
Get Music On Hold
Retrieve the location’s music on hold settings.
Location’s music on hold settings allows you to play music when a call is placed on hold or parked.
Retrieving location’s music on hold settings requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve access codes details for this location.
settings (
LocationMoHSetting
) – new settingsorg_id (str) – Retrieve access codes details for a customer location in this organization
- Returns:
list of
wxc_sdk.common.CallPark
- async create(location_id: str, access_codes: list[wxc_sdk.common.AuthCode], org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
- Parameters:
location_id (str) – Add new access code for this location.
access_codes (list of
wxc_sdk.common.AuthCode
) – Access code detailsorg_id (str) – Add new access code for this organization.
- async delete_codes(location_id: str, access_codes: list[Union[str, wxc_sdk.common.AuthCode]], org_id: str | None = None) list[wxc_sdk.common.AuthCode] [source]
Delete Access Code Location
Deletes the access code details for a particular location for a customer.
Use Access Codes to bypass the set permissions for all persons/workspaces at this location.
Modifying the access code location details requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Deletes the access code details for this location.
access_codes (list of
wxc_sdk.common.AuthCode
or str) – access codes to deleteorg_id (str) – Delete access codes from this organization.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsLocationNumbersApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- async add(location_id: str, phone_numbers: list[str], state: NumberState = NumberState.inactive, org_id: str | None = None)[source]
Adds specified set of phone numbers to a location for an organization.
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.
Adding a phone number to a location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – LocationId to which numbers should be added.
phone_numbers (list[str]) – List of phone numbers that need to be added.
state (
wxc_sdk.common.NumberState
) – State of the phone numbers.org_id (str) – Organization to manage
- async activate(location_id: str, phone_numbers: list[str], org_id: str | None = None)[source]
Activate the specified set of phone numbers in a location for an organization.
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.
Activating a phone number in a location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – LocationId in which numbers should be activated.
phone_numbers (list[str]) – List of phone numbers to be activated.
org_id (str) – Organization to manage
- async remove(location_id: str, phone_numbers: list[str], org_id: str | None = None)[source]
Remove the specified set of phone numbers from a location for an organization.
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.
Removing a phone number from a location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – LocationId from which numbers should be removed.
phone_numbers (list[str]) – List of phone numbers to be removed.
org_id (str) – Organization to manage
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsLocationVoicemailSettingsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
location voicemail settings API, for now only enable/disable Vm transcription
- async read(location_id: str, org_id: str | None = None) LocationVoiceMailSettings [source]
Get Location Voicemail
Retrieve voicemail settings for a specific location.
Location’s voicemail settings allows you to enable voicemail transcription for a specific location.
Retrieving location’s voicemail settings requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve access codes details for this location.
org_id (str) – Retrieve access codes details for a customer location in this organization
- Returns:
location voicemail settings
- Return type:
LocationVoiceMailSettings
- async update(location_id: str, settings: LocationVoiceMailSettings, org_id: str | None = None)[source]
Get Location Voicemail
Retrieve voicemail settings for a specific location.
Location’s voicemail settings allows you to enable voicemail transcription for a specific location.
Retrieving location’s voicemail settings requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve access codes details for this location.
settings (
LocationVoiceMailSettings
) – new settingsorg_id (str) – Retrieve access codes details for a customer location in this organization
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsLocationsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Location API
Locations are used to organize Webex Calling (BroadCloud) features within physical locations. Webex Control Hub may be used to define new locations.
Searching and viewing locations in your organization requires an administrator auth token with the spark-admin:people_read and spark-admin:people_write or spark-admin:device_read AND spark-admin:device_write scope combinations.
- list_gen(name: str | None = None, location_id: str | None = None, org_id: str | None = None, **params) AsyncGenerator[Location, None, None] [source]
List locations for an organization.
- Parameters:
name (str) – List locations whose name contains this string (case-insensitive).
location_id (str) – List locations by ID.
org_id (str) – List locations in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
generator of
Location
instances
- async list(name: str | None = None, location_id: str | None = None, org_id: str | None = None, **params) List[Location] [source]
List locations for an organization.
- Parameters:
name (str) – List locations whose name contains this string (case-insensitive).
location_id (str) – List locations by ID.
org_id (str) – List locations in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
generator of
Location
instances
- async by_name(name: str, org_id: str | None = None) Location | None [source]
Get a location by name
- Parameters:
name (str) – name of the location to search
org_id (str) – search in list of locations in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
locations
- Return type:
- async details(location_id) Location [source]
Shows details for a location, by ID.
This API only works for Customer administrators and for Partner administrators to query their own organization. Partner administrators looking to query customer organizations should use the List Locations endpoint to retrieve information about locations.
- Parameters:
location_id (str) – A unique identifier for the location.
- Returns:
location details
- Return type:
Location
- async create(name: str, time_zone: str, preferred_language: str, announcement_language: str, address1: str, city: str, state: str, postal_code: str, country: str, address2: str | None = None, org_id: str | None = None) str [source]
Create a new Location for a given organization. Only an admin in a Webex Calling licensed organization can create a new Location.
The following body parameters are required to create a new location: name, timeZone, preferredLanguage, address, announcementLanguage.
Creating a location in your organization requires an administrator auth token with the spark-admin:locations_write.
- Parameters:
name (str) – The name of the location.
time_zone (str) – Time zone associated with this location
preferred_language (str) – Default email language.
announcement_language (str) – Location’s phone announcement language.
address1 (str) – Address 1
address2 (str) – Address 2
city (str) – City
state (str) – State Code
postal_code (str) – Postal Code
country (str) – ISO-3166 2-Letter Country Code.
org_id (str) – Create a location common attribute for this organization.
- Returns:
ID of new location
- Return type:
Location
- async update(location_id: str, settings: Location, org_id: str | None = None)[source]
Update details for a location, by ID.
Specify the location ID in the locationId parameter in the URI. Only an admin can update a location details.
Updating a location in your organization requires an administrator auth token with the spark-admin:locations_write.
- Parameters:
location_id (str) – Update location common attributes for this location.
settings (
Location
) – new settings for the org:org_id (str) – Update location common attributes for this organization
- base = 'locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsManageNumbersJobsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for jobs to manage numbers
- list_jobs_gen(org_id: str | None = None, **params) AsyncGenerator[NumberJob, None, None] [source]
Lists all Manage Numbers jobs for the given organization in order of most recent one to oldest one irrespective of its status. The public API only supports initiating jobs which move numbers between locations. Via Control Hub they can initiate both the move and delete, so this listing can show both. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of Manage Number jobs for this organization.
- async list_jobs(org_id: str | None = None, **params) List[NumberJob] [source]
Lists all Manage Numbers jobs for the given organization in order of most recent one to oldest one irrespective of its status. The public API only supports initiating jobs which move numbers between locations. Via Control Hub they can initiate both the move and delete, so this listing can show both. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of Manage Number jobs for this organization.
- async initiate_job(operation: str, target_location_id: str, number_list: list[wxc_sdk.telephony.jobs.NumberItem]) NumberJob [source]
Starts the numbers move from one location to another location. Although jobs can do both MOVE and DELETE actions internally, only MOVE is supported publicly. In order to move a number, For example, you can move from Cisco PSTN to Cisco PSTN, but you cannot move from Cisco PSTN to a location with Cloud Connected PSTN. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
operation (str) – Indicates the kind of operation to be carried out.
target_location_id (str) – The target location within organization where the unassigned numbers will be moved from the source location.
number_list (list[NumberItem]) – Indicates the numbers to be moved from source to target locations.
- async job_status(job_id: str | None = None) NumberJob [source]
Returns the status and other details of the job. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve job details for this jobId.
- async pause_job(job_id: str | None = None, org_id: str | None = None)[source]
Pause the running Manage Numbers Job. A paused job can be resumed or abandoned. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Pause the Manage Numbers job for this jobId.
org_id (str) – Pause the Manage Numbers job for this organization.
- async resume_job(job_id: str | None = None, org_id: str | None = None)[source]
Resume the paused Manage Numbers Job. A paused job can be resumed or abandoned. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Resume the Manage Numbers job for this jobId.
org_id (str) – Resume the Manage Numbers job for this organization.
- async abandon_job(job_id: str | None = None, org_id: str | None = None)[source]
Abandon the Manage Numbers Job. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Abandon the Manage Numbers job for this jobId.
org_id (str) – Abandon the Manage Numbers job for this organization.
- list_job_errors_gen(job_id: str | None = None, org_id: str | None = None, **params) AsyncGenerator[ManageNumberErrorItem, None, None] [source]
Lists all error details of Manage Numbers job. This will not list any errors if exitCode is COMPLETED. If the status is COMPLETED_WITH_ERRORS then this lists the cause of failures. List of possible Errors: This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve the error details for this jobId.
org_id (str) – Retrieve list of jobs for this organization.
- async list_job_errors(job_id: str | None = None, org_id: str | None = None, **params) List[ManageNumberErrorItem] [source]
Lists all error details of Manage Numbers job. This will not list any errors if exitCode is COMPLETED. If the status is COMPLETED_WITH_ERRORS then this lists the cause of failures. List of possible Errors: This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve the error details for this jobId.
org_id (str) – Retrieve list of jobs for this organization.
- base = 'telephony/config/jobs/numbers'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsMembershipApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Memberships represent a person’s relationship to a room. Use this API to list members of any room that you’re in or create memberships to invite someone to a room. Compliance Officers can now also list memberships for personEmails where the CO is not part of the room. Memberships can also be updated to make someone a moderator, or deleted, to remove someone from the room. Just like in the Webex client, you must be a member of the room in order to list its memberships or invite people.
- list_gen(room_id: str | None = None, person_id: str | None = None, person_email: str | None = None, **params) AsyncGenerator[Membership, None, None] [source]
Lists all room memberships. By default, lists memberships for rooms to which the authenticated user belongs. Use query parameters to filter the response. Use roomId to list memberships for a room, by ID. NOTE: For moderated team spaces, the list of memberships will include only the space moderators if the user is a team member but not a direct participant of the space. Use either personId or personEmail to filter the results. The roomId parameter is required when using these parameters. Long result sets will be split into pages.
- Parameters:
room_id (str) – List memberships associated with a room, by ID.
person_id (str) – List memberships associated with a person, by ID. The roomId parameter is required when using this parameter.
person_email (str) – List memberships associated with a person, by email address. The roomId parameter is required when using this parameter.
- async list(room_id: str | None = None, person_id: str | None = None, person_email: str | None = None, **params) List[Membership] [source]
Lists all room memberships. By default, lists memberships for rooms to which the authenticated user belongs. Use query parameters to filter the response. Use roomId to list memberships for a room, by ID. NOTE: For moderated team spaces, the list of memberships will include only the space moderators if the user is a team member but not a direct participant of the space. Use either personId or personEmail to filter the results. The roomId parameter is required when using these parameters. Long result sets will be split into pages.
- Parameters:
room_id (str) – List memberships associated with a room, by ID.
person_id (str) – List memberships associated with a person, by ID. The roomId parameter is required when using this parameter.
person_email (str) – List memberships associated with a person, by email address. The roomId parameter is required when using this parameter.
- async create(room_id: str, person_id: str | None = None, person_email: str | None = None, is_moderator: bool | None = None) Membership [source]
Add someone to a room by Person ID or email address, optionally making them a moderator.
- Parameters:
room_id (str) – The room ID.
person_id (str) – The person ID.
person_email (str) – The email address of the person.
is_moderator (bool) – Whether or not the participant is a room moderator.
- async details(membership_id: str) Membership [source]
Get details for a membership by ID. Specify the membership ID in the membershipId URI parameter.
- Parameters:
membership_id (str) – The unique identifier for the membership.
- async update(update: Membership) Membership [source]
Updates properties for a membership by ID
- Parameters:
update (Membership) –
new settings; ID has to be set in update.
- These can be updated:
is_moderator: bool: Whether or not the participant is a room moderator.
is_room_hidden: bool: When set to true, hides direct spaces in the teams client. Any new message will make the room visible again.
- async delete(membership_id: str)[source]
Deletes a membership by ID. Specify the membership ID in the membershipId URI parameter. The membership for the last moderator of a Team’s General space may not be deleted; promote another user to team moderator first.
- Parameters:
membership_id (str) – The unique identifier for the membership.
- base = 'memberships'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsMessagesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- list_gen(room_id: str, parent_id: str | None = None, mentioned_people: List[str] | None = None, before: datetime | None = None, before_message: str | None = None, **params) AsyncGenerator[Message, None, None] [source]
Lists all messages in a room. Each message will include content attachments if present. The list sorts the messages in descending order by creation date. Long result sets will be split into pages.
- Parameters:
room_id (str) – List messages in a room, by ID.
parent_id (str) – List messages with a parent, by ID.
mentioned_people (List[str]) – List messages with these people mentioned, by ID. Use me as a shorthand for the current API user. Only me or the person ID of the current user may be specified. Bots must include this parameter to list messages in group rooms (spaces).
before (str) – List messages sent before a date and time.
before_message (str) – List messages sent before a message, by ID.
- async list(room_id: str, parent_id: str | None = None, mentioned_people: List[str] | None = None, before: datetime | None = None, before_message: str | None = None, **params) List[Message] [source]
Lists all messages in a room. Each message will include content attachments if present. The list sorts the messages in descending order by creation date. Long result sets will be split into pages.
- Parameters:
room_id (str) – List messages in a room, by ID.
parent_id (str) – List messages with a parent, by ID.
mentioned_people (List[str]) – List messages with these people mentioned, by ID. Use me as a shorthand for the current API user. Only me or the person ID of the current user may be specified. Bots must include this parameter to list messages in group rooms (spaces).
before (str) – List messages sent before a date and time.
before_message (str) – List messages sent before a message, by ID.
- list_direct_gen(parent_id: str | None = None, person_id: str | None = None, person_email: str | None = None, **params) AsyncGenerator[Message, None, None] [source]
List all messages in a 1:1 (direct) room. Use the personId or personEmail query parameter to specify the room. Each message will include content attachments if present. The list sorts the messages in descending order by creation date.
- Parameters:
parent_id (str) – List messages with a parent, by ID.
person_id (str) – List messages in a 1:1 room, by person ID.
person_email (str) – List messages in a 1:1 room, by person email.
- async list_direct(parent_id: str | None = None, person_id: str | None = None, person_email: str | None = None, **params) List[Message] [source]
List all messages in a 1:1 (direct) room. Use the personId or personEmail query parameter to specify the room. Each message will include content attachments if present. The list sorts the messages in descending order by creation date.
- Parameters:
parent_id (str) – List messages with a parent, by ID.
person_id (str) – List messages in a 1:1 room, by person ID.
person_email (str) – List messages in a 1:1 room, by person email.
- async create(room_id: str | None = None, parent_id: str | None = None, to_person_id: str | None = None, to_person_email: str | None = None, text: str | None = None, markdown: str | None = None, files: List[str] | None = None, attachments: List[dict | MessageAttachment] | None = None) Message [source]
Post a plain text or rich text message, and optionally, a file attachment, to a room. The files parameter is an array, which accepts multiple values to allow for future expansion, but currently only one file may be included with the message. File previews are only rendered for attachments of 1MB or less.
- Parameters:
room_id (str) – The room ID of the message.
parent_id (str) – The parent message to reply to.
to_person_id (str) – The person ID of the recipient when sending a private 1:1 message.
to_person_email (str) – The email address of the recipient when sending a private 1:1 message.
text (str) – The message, in plain text. If markdown is specified this parameter may be optionally used to provide alternate text for UI clients that do not support rich text. The maximum message length is 7439 bytes.
markdown (str) – The message, in Markdown format. The maximum message length is 7439 bytes.
files (List[str]) – The public URL to a binary file or a path to a local file to be posted into the room. Only one file is allowed per message. Uploaded files are automatically converted into a format that all Webex clients can render. For the supported media types and the behavior of uploads, see the Message Attachments Guide.
attachments (List[Attachment]) – Content attachments to attach to the message. Only one card per message is supported. See the Cards Guide for more information.
- Return type:
- async edit(message: Message) Message [source]
Update a message you have posted not more than 10 times. Specify the messageId of the message you want to edit. Edits of messages containing files or attachments are not currently supported. If a user attempts to edit a message containing files or attachments a 400 Bad Request will be returned by the API with a message stating that the feature is currently unsupported. There is also a maximum number of times a user can edit a message. The maximum currently supported is 10 edits per message. If a user attempts to edit a message greater that the maximum times allowed the API will return 400 Bad Request with a message stating the edit limit has been reached. While only the roomId and text or markdown attributes are required in the request body, a common pattern for editing message is to first call GET /messages/{id} for the message you wish to edit and to then update the text or markdown attribute accordingly, passing the updated message object in the request body of the PUT /messages/{id} request.
- Parameters:
message –
the updated message, id has to be set in the message attributes supported for update:
room_id: str: The room ID of the message.
text: str: The message, in plain text. If markdown is specified this parameter may be optionally used to provide alternate text for UI clients that do not support rich text. The maximum message length is 7439 bytes.
markdown: str: The message, in Markdown format. If this attribute is set ensure that the request does NOT contain an html attribute.
- async details(message_id: str) Message [source]
Show details for a message, by message ID. Specify the message ID in the messageId parameter in the URI.
- Parameters:
message_id (str) – The unique identifier for the message.
- async delete(message_id: str)[source]
Delete a message, by message ID. Specify the message ID in the messageId parameter in the URI.
- Parameters:
message_id (str) – The unique identifier for the message.
- base = 'messages'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsMonitoringApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call monitoring settings
- feature = 'monitoring'
- async read(person_id: str, org_id: str | None = None) Monitoring [source]
Retrieve a Person’s Monitoring Settings
Retrieves the monitoring settings of the person, which shows specified people, places or, call park extensions under monitoring. Monitors the line status which indicates if a person or place is on a call and if a call has been parked on that extension.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
monitoring settings
- Return type:
Monitoring
- async configure(person_id: str, settings: Monitoring, org_id: str | None = None)[source]
Configure Call Waiting Settings for a Person
Configure a Person’s Call Waiting Settings
With this feature, a person can place an active call on hold and answer an incoming call. When enabled, while you are on an active call, a tone alerts you of an incoming call and you can choose to answer or ignore the call.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
Monitoring
) – settings for updateorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsNumbersApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s numbers
- feature = 'numbers'
- async 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:
PersonNumbers
- async 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: AsRestSession
REST session
- class wxc_sdk.as_api.AsOrganisationVoicemailSettingsAPI(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for Organisation voicemail settings
- async read(org_id: str | None = None) OrganisationVoicemailSettings [source]
Get Voicemail Settings
Retrieve the organization’s voicemail settings.
Organizational voicemail settings determines what voicemail features a person can configure and automatic message expiration.
Retrieving organization’s voicemail settings requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve voicemail settings for this organization.
- Returns:
VM settings
- Return type:
- async update(settings: OrganisationVoicemailSettings, org_id: str | None = None)[source]
Update the organization’s voicemail settings.
Organizational voicemail settings determines what voicemail features a person can configure and automatic message expiration.
Updating organization’s voicemail settings requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
settings (OrganisationVoicemailSettings) – new settings
org_id (str) – Update voicemail settings for this organization.
- base = 'telephony/config/voicemail/settings'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsOrganizationApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- async list() list[wxc_sdk.organizations.Organization] [source]
List all organizations visible by your account. The results will not be paginated.
- Returns:
list of Organizations
- async details(org_id: str) Organization [source]
Get Organization Details
Shows details for an organization, by ID.
- Parameters:
org_id (str) – The unique identifier for the organization.
- Returns:
org details
- Return type:
Organization
- async delete(org_id: str)[source]
Delete Organization
Deletes an organization, by ID. It may take up to 10 minutes for the organization to be deleted after the response is returned.
- Parameters:
org_id (str) – The unique identifier for the organization.
- base = 'organizations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsOutgoingPermissionsApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s outgoing permissions settings
also used for workspace and location outgoing permissions
- feature = 'outgoingPermission'
- transfer_numbers: AsTransferNumbersApi
Only available for workspaces and locations
- auth_codes: AsAuthCodesApi
Only available for workspaces
- async read(person_id: str, org_id: str | None = None) OutgoingPermissions [source]
Retrieve a Person’s Outgoing Calling Permissions Settings
You can change the outgoing calling permissions for a person if you want them to be different from your organization’s default.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
outgoing permission settings for specific user
- Return type:
OutgoingPermissions
- async configure(person_id: str, settings: OutgoingPermissions, drop_call_types: set[str] | None = None, org_id: str | None = None)[source]
Configure a Person’s Outgoing Calling Permissions Settings
Turn on outgoing call settings for this person to override the calling settings from the location that are used by default.
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 person to update their own settings.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
OutgoingPermissions
) – new setting to be applieddrop_call_types (set[str]) – set of call type names to be excluded from updates. Default is the set of call_types known to be not supported for updates
org_id – 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.
- base = ''
- class wxc_sdk.as_api.AsPagingApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- list_gen(location_id: str | None = None, name: str | None = None, phone_number: str | None = None, org_id: str | None = None, **params) AsyncGenerator[Paging, None, None] [source]
Read the List of Paging Groups List all Paging Groups for the organization.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return only paging groups with matching location ID. Default is all locations
name (str) – Return only paging groups with the matching name.
phone_number (str) – Return only paging groups with matching primary phone number or extension.
org_id (str) – List paging groups for this organization.
- Returns:
generator of class:Paging objects
- async list(location_id: str | None = None, name: str | None = None, phone_number: str | None = None, org_id: str | None = None, **params) List[Paging] [source]
Read the List of Paging Groups List all Paging Groups for the organization.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return only paging groups with matching location ID. Default is all locations
name (str) – Return only paging groups with the matching name.
phone_number (str) – Return only paging groups with matching primary phone number or extension.
org_id (str) – List paging groups for this organization.
- Returns:
generator of class:Paging objects
- async create(location_id: str, settings: Paging, org_id: str | None = None) str [source]
Create a new Paging Group Create a new Paging Group for the given location.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Creating a paging group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create the paging group for this location.
settings (Paging) – new paging group
org_id (str) – Create the paging group for this organization.
- Returns:
ID of the newly created paging group.
- Return type:
str
- async delete_paging(location_id: str, paging_id: str, org_id: str | None = None)[source]
Delete a Paging Group Delete the designated Paging Group.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Deleting a paging group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete a paging group.
paging_id – Delete the paging group with the matching ID.
org_id – Delete the paging group from this organization.
- async details(location_id: str, paging_id: str, org_id: str | None = None) Paging [source]
Get Details for a Paging Group Retrieve Paging Group details.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Retrieving paging group details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read. :param location_id: Retrieve settings for a paging group in this location. :param paging_id: Retrieve settings for the paging group with this identifier. :param org_id: Retrieve paging group settings from this organization. :return:
Paging
object
- async update(location_id: str, update: Paging, paging_id: str, org_id: str | None = None)[source]
Update the designated Paging Group.
Group Paging allows a person to place a one-way call or group page to up to 75 people and/or workspaces by dialing a number or extension assigned to a specific paging group. The Group Paging service makes a simultaneous call to all the assigned targets.
Updating a paging group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Update settings for a paging group in this location.
update (Paging) – update parameters
paging_id (str) – Update settings for the paging group with this identifier.
org_id (str) – Update paging group settings from this organization.
- base = 'telephony/config'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPeopleApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
People API
- list_gen(email: str | None = None, display_name: str | None = None, id_list: list[str] | None = None, org_id: str | None = None, calling_data: bool | None = None, location_id: str | None = None, **params) AsyncGenerator[Person, None, None] [source]
List people in your organization. For most users, either the email or displayName parameter is required. Admin users can omit these fields and list all users in their organization.
Response properties associated with a user’s presence status, such as status or lastActivity, will only be returned for people within your organization or an organization you manage. Presence information will not be returned if the authenticated user has disabled status sharing.
Admin users can include Webex Calling (BroadCloud) user details in the response by specifying callingData parameter as true. Admin users can list all users in a location or with a specific phone number. Admin users will receive an enriched payload with additional administrative fields like liceneses,roles etc. These fields are shown when accessing a user via GET /people/{id}, not when doing a GET /people?id=
Lookup by email is only supported for people within the same org or where a partner admin relationship is in place.
- Parameters:
email (str) – List people with this email address. For non-admin requests, either this or displayName are required.
display_name (str) – List people whose name starts with this string. For non-admin requests, either this or email are required.
id_list (list[str]) – List people by ID. Accepts up to 85 person IDs. If this parameter is provided then presence information (such as the last_activity or status properties) will not be included in the response.
org_id (str) – List people in this organization. Only admin users of another organization (such as partners) may use this parameter.
calling_data (bool) – Include Webex Calling user details in the response. Default: False
location_id (str) – List people present in this location.
- Returns:
yield
Person
instances
- async list(email: str | None = None, display_name: str | None = None, id_list: list[str] | None = None, org_id: str | None = None, calling_data: bool | None = None, location_id: str | None = None, **params) List[Person] [source]
List people in your organization. For most users, either the email or displayName parameter is required. Admin users can omit these fields and list all users in their organization.
Response properties associated with a user’s presence status, such as status or lastActivity, will only be returned for people within your organization or an organization you manage. Presence information will not be returned if the authenticated user has disabled status sharing.
Admin users can include Webex Calling (BroadCloud) user details in the response by specifying callingData parameter as true. Admin users can list all users in a location or with a specific phone number. Admin users will receive an enriched payload with additional administrative fields like liceneses,roles etc. These fields are shown when accessing a user via GET /people/{id}, not when doing a GET /people?id=
Lookup by email is only supported for people within the same org or where a partner admin relationship is in place.
- Parameters:
email (str) – List people with this email address. For non-admin requests, either this or displayName are required.
display_name (str) – List people whose name starts with this string. For non-admin requests, either this or email are required.
id_list (list[str]) – List people by ID. Accepts up to 85 person IDs. If this parameter is provided then presence information (such as the last_activity or status properties) will not be included in the response.
org_id (str) – List people in this organization. Only admin users of another organization (such as partners) may use this parameter.
calling_data (bool) – Include Webex Calling user details in the response. Default: False
location_id (str) – List people present in this location.
- Returns:
yield
Person
instances
- async create(settings: Person, calling_data: bool = False) Person [source]
Create a Person
Create a new user account for a given organization. Only an admin can create a new user account.
At least one of the following body parameters is required to create a new user: displayName, firstName, lastName.
Currently, users may have only one email address associated with their account. The emails parameter is an array, which accepts multiple values to allow for future expansion, but currently only one email address will be used for the new user.
Admin users can include Webex calling (BroadCloud) user details in the response by specifying callingData parameter as true.
When doing attendee management, to make the new user an attendee for a site: append #attendee to the siteUrl parameter (eg: mysite.webex.com#attendee).
- async details(person_id: str, calling_data: bool = False) Person [source]
Shows details for a person, by ID.
Response properties associated with a user’s presence status, such as status or last_activity, will only be displayed for people within your organization or an organization you manage. Presence information will not be shown if the authenticated user has disabled status sharing.
Admin users can include Webex Calling (BroadCloud) user details in the response by specifying calling_data parameter as True.
- Parameters:
person_id (str) – A unique identifier for the person.
calling_data (bool) – Include Webex Calling user details in the response. Default: false
- Returns:
person details
- Return type:
- async delete_person(person_id: str)[source]
Remove a person from the system. Only an admin can remove a person.
- Parameters:
person_id – A unique identifier for the person.
- Returns:
- async update(person: Person, calling_data: bool = False, show_all_types: bool = False) Person [source]
Update details for a person, by ID.
Specify the person ID in the personId parameter in the URI. Only an admin can update a person details.
Include all details for the person. This action expects all user details to be present in the request. A common approach is to first GET the person’s details, make changes, then PUT both the changed and unchanged values.
Admin users can include Webex Calling (BroadCloud) user details in the response by specifying callingData parameter as true.
Note: The locationId can only be set when adding a calling license to a user. It cannot be changed if a user is already an existing calling user.
When doing attendee management, to update a user from host role to an attendee for a site append #attendee to the respective siteUrl and remove the meeting host license for this site from the license array.
To update a person from an attendee role to a host for a site, add the meeting license for this site in the meeting array, and remove that site from the siteurl parameter.
To remove the attendee privilege for a user on a meeting site, remove the sitename#attendee from the siteUrls array. The showAllTypes parameter must be set to true.
- async me(calling_data: bool = False) Person [source]
Show the profile for the authenticated user. This is the same as GET /people/{personId} using the Person ID associated with your Auth token.
Admin users can include Webex Calling (BroadCloud) user details in the response by specifying callingData parameter as true.
- Parameters:
calling_data (bool) – True -> return calling data
- Return type:
- Returns:
profile of authenticated user
- base = 'people'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPersonForwardingApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call forwarding settings
- feature = 'callForwarding'
- async read(person_id: str, org_id: str | None = None) PersonForwardingSetting [source]
Retrieve a Person’s Call Forwarding Settings
Three types of call forwarding are supported:
Always – forwards all incoming calls to the destination you choose.
When busy – forwards all incoming calls to the destination you chose while the phone is in use or the person is busy.
When no answer – forwarding only occurs when you are away or not answering your phone.
In addition, the Business Continuity feature will send calls to a destination of your choice if your phone is not connected to the network for any reason, such as power outage, failed Internet connection, or wiring problem
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 person to read their own settings.
- 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:
user’s forwarding settings
- Return type:
- async configure(person_id: str, forwarding: PersonForwardingSetting, org_id: str | None = None)[source]
Configure a Person’s Call Forwarding Settings
Three types of call forwarding are supported:
Always – forwards all incoming calls to the destination you choose.
When busy – forwards all incoming calls to the destination you chose while the phone is in use or the person is busy.
When no answer – forwarding only occurs when you are away or not answering your phone.
In addition, the Business Continuity feature will send calls to a destination of your choice if your phone is not connected to the network for any reason, such as power outage, failed Internet connection, or wiring problem
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 person to update their settings.
- Parameters:
person_id (str) – Unique identifier for the person.
forwarding (PersonForwardingSetting) – new forwarding settings
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPersonSettingsApi(session: AsRestSession)[source]
Bases:
AsApiChild
API for all user level settings
- agent_caller_id: AsAgentCallerIdApi
agent caller id Api
- appservices: AsAppServicesApi
Person’s Application Services Settings
- barge: AsBargeApi
Barge In Settings for a Person
- call_intercept: AsCallInterceptApi
Call Intercept Settings for a Person
- call_recording: AsCallRecordingApi
Call Recording Settings for a Person
- call_waiting: AsCallWaitingApi
Call Waiting Settings for a Person
- calling_behavior: AsCallingBehaviorApi
Person’s Calling Behavior
- caller_id: AsCallerIdApi
Caller ID Settings for a Person
- exec_assistant: AsExecAssistantApi
Executive Assistant Settings for a Person
- forwarding: AsPersonForwardingApi
Forwarding Settings for a Person
- hoteling: AsHotelingApi
Hoteling Settings for a Person
- monitoring: AsMonitoringApi
Person’s Monitoring Settings
- numbers: AsNumbersApi
Phone Numbers for a Person
- permissions_in: AsIncomingPermissionsApi
Incoming Permission Settings for a Person
- permissions_out: AsOutgoingPermissionsApi
Person’s Outgoing Calling Permissions Settings
- privacy: AsPrivacyApi
Person’s Privacy Settings
- push_to_talk: AsPushToTalkApi
Push-to-Talk Settings for a Person
- receptionist: AsReceptionistApi
Receptionist Client Settings for a Person
- schedules: AsScheduleApi
Schedules for a Person
- voicemail: AsVoicemailApi
Voicemail Settings for a Person
- async reset_vm_pin(person_id: str, org_id: str | None = None)[source]
Reset Voicemail PIN
Reset a voicemail PIN for a person.
The voicemail feature transfers callers to voicemail based on your settings. You can then retrieve voice messages via Voicemail. A voicemail PIN is used to retrieve your voicemail messages.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id – Unique identifier for the person.
org_id – 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.
- async devices(person_id: str, org_id: str | None = None) PersonDevicesResponse [source]
Get all devices for a person.
This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
person_id (str) – Person to retrieve devices for
org_id (str) – organization that person belongs to
- Returns:
device info for user
- Return type:
- base = 'people'
- class wxc_sdk.as_api.AsPersonSettingsApiChild(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsApiChild
Base class for all classes implementing person settings APIs
- feature = None
- f_ep(person_id: str, path: str | None = None) str [source]
person specific feature endpoint like v1/people/{uid}/features/….
- Parameters:
person_id (str) – Unique identifier for the person.
path (str) – path in the endpoint after the feature base URL
- Returns:
full endpoint
- Return type:
str
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPremisePstnApi(session: AsRestSession)[source]
Bases:
AsApiChild
Premises PSTN API
- dial_plan: AsDialPlanApi
dial plan configuration
- trunk: AsTrunkApi
trunk configuration
- route_group: AsRouteGroupApi
route group configuration
- route_list: AsRouteListApi
route list configuration
- async validate_pattern(dial_patterns: str | List[str], org_id: str | None = None) DialPatternValidationResult [source]
Validate a Dial Pattern.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Validating a dial pattern requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
dial_patterns (list[str] or str) – Array of dial patterns.
org_id – Organization to which dial plan belongs.
- Returns:
validation result
- Return type:
DialPatternValidationResult
- base = 'telephony/config/premisePstn'
- class wxc_sdk.as_api.AsPrivacyApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call monitoring settings
- feature = 'privacy'
- async read(person_id: str, org_id: str | None = None) Privacy [source]
Get a person’s Privacy Settings
Get a person’s privacy settings for the specified person id.
The privacy feature enables the person’s line to be monitored by others and determine if they can be reached by Auto Attendant services.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
privacy settings
- Return type:
Privacy
- async configure(person_id: str, settings: Privacy, org_id: str | None = None)[source]
Configure Call Waiting Settings for a Person
Configure a Person’s Call Waiting Settings
With this feature, a person can place an active call on hold and answer an incoming call. When enabled, while you are on an active call, a tone alerts you of an incoming call and you can choose to answer or ignore the call.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
Monitoring
) – settings for updateorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPrivateNetworkConnectApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for location private network connect API settings
- async read(location_id: str, org_id: str | None = None) NetworkConnectionType [source]
Get Private Network Connect
Retrieve the location’s network connection type.
Network Connection Type determines if the location’s network connection is public or private.
Retrieving location’s network connection type requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve network connection type for this location.
org_id (str) – Retrieve network connection type for this organization.
- Returns:
location PNC settings
- Return type:
- async update(location_id: str, connection_type: NetworkConnectionType, org_id: str | None = None)[source]
Get Private Network Connect
Retrieve the location’s network connection type.
Network Connection Type determines if the location’s network connection is public or private.
Retrieving location’s network connection type requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Update network connection type for this location.
connection_type (NetworkConnectionType) – Network Connection Type for the location.
org_id (str) – Update network connection type for this organization.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsPushToTalkApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s PTT settings
- feature = 'pushToTalk'
- async read(person_id: str, org_id: str | None = None) PushToTalkSettings [source]
Read Push-to-Talk Settings for a Person Retrieve a Person’s Push-to-Talk Settings
Push-to-Talk allows the use of desk phones as either a one-way or two-way intercom that connects people in different parts of your organization.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
PTT settings for specific user
- Return type:
- async configure(person_id: str, settings: PushToTalkSettings, org_id: str | None = None)[source]
Configure Push-to-Talk Settings for a Person
Configure a Person’s Push-to-Talk Settings
Push-to-Talk allows the use of desk phones as either a one-way or two-way intercom that connects people in different parts of your organization.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (PushToTalkSettings) – new setting to be applied. For members only the ID needs to be set
org_id – 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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsReceptionistApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s receptionist client settings
- feature = 'reception'
- async read(person_id: str, org_id: str | None = None) ReceptionistSettings [source]
Read Receptionist Client Settings for a Person
Retrieve a Person’s Receptionist Client Settings
To help support the needs of your front-office personnel, you can set up people or workspaces as telephone attendants so that they can screen all incoming calls to certain numbers within your organization.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- 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:
receptionist client settings
- Return type:
ReceptionistSettings
- async configure(person_id: str, settings: ReceptionistSettings, org_id: str | None = None)[source]
Modify Executive Assistant Settings for a Person
Modify the executive assistant settings for the specified personId.
People with the executive service enabled, can select from a pool of assistants who have been assigned the executive assistant service and who can answer or place calls on their behalf. Executive assistants can set the call forward destination and join or leave an executive’s pool.
This API requires a full or user administrator auth token with the spark-admin:people_write scope.
- Parameters:
person_id (str) – Unique identifier for the person.
settings (
ReceptionistSettings
) – New receptionist client settingsorg_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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsReceptionistContactsDirectoryApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- async create(location_id: str, name: str, contacts: list[str], org_id: str | None = None)[source]
Creates a new Receptionist Contact Directory for a location.
Receptionist Contact Directories can be used to create named directories of users.
Adding a directory requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Add a Receptionist Contact Directory to this location.
name (str) – Receptionist Contact Directory name.
contacts (list[str]) – Array of user or workspace ids assigned to this Receptionist Contact Directory
org_id (str) – Add a Receptionist Contact Directory to this organization.
- list_gen(location_id: str, org_id: str | None = None) AsyncGenerator[IdAndName, None, None] [source]
List all Receptionist Contact Directories for a location.
Receptionist Contact Directories can be used to create named directories of users.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – List Receptionist Contact Directories for this location.
org_id (str) – List Receptionist Contact Directories for this organization.
- Returns:
Yields IdAndName instances
- async list(location_id: str, org_id: str | None = None) List[IdAndName] [source]
List all Receptionist Contact Directories for a location.
Receptionist Contact Directories can be used to create named directories of users.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – List Receptionist Contact Directories for this location.
org_id (str) – List Receptionist Contact Directories for this organization.
- Returns:
Yields IdAndName instances
- async delete(location_id: str, directory_id: str, org_id: str | None = None)[source]
Delete a Receptionist Contact Directory from a location.
Receptionist Contact Directories can be used to create named directories of users.
Deleting a directory requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id – Delete a Receptionist Contact Directory from this location.
directory_id – ID of directory to delete.
org_id – Delete a Receptionist Contact Directory from this organization.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsReportsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Report templates are available for use with the Reports API.
To access this endpoint, you must use an administrator token with the analytics:read_all scope. The authenticated user must be a read-only or full administrator of the organization to which the report belongs.
To use this endpoint the organization needs to be licensed for Pro Pack for Control Hub.
Reports available via Webex Control Hub may be generated and downloaded via the Reports API. To access this API, the authenticated user must be a read-only or full administrator of the organization to which the report belongs.
- async list_templates() list[wxc_sdk.reports.ReportTemplate] [source]
List all the available report templates that can be generated.
CSV (comma separated value) reports for Webex services are only supported for organizations based in the North American region. Organizations based in other regions will return blank CSV files for any Webex reports.
- Returns:
list of report templates
- Return type:
list[ReportTemplate]
- list_gen(report_id: str | None = None, service: str | None = None, template_id: str | None = None, from_date: date | None = None, to_date: date | None = None) AsyncGenerator[Report, None, None] [source]
Lists all reports. Use query parameters to filter the response. The parameters are optional. However, from and to parameters should be provided together.
CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.
- Parameters:
report_id – List reports by ID.
service – List reports which use this service.
template_id – List reports with this report template ID.
from_date – List reports that were created on or after this date.
to_date – List reports that were created before this date.
- Returns:
yields
Report
instances
- async list(report_id: str | None = None, service: str | None = None, template_id: str | None = None, from_date: date | None = None, to_date: date | None = None) List[Report] [source]
Lists all reports. Use query parameters to filter the response. The parameters are optional. However, from and to parameters should be provided together.
CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.
- Parameters:
report_id – List reports by ID.
service – List reports which use this service.
template_id – List reports with this report template ID.
from_date – List reports that were created on or after this date.
to_date – List reports that were created before this date.
- Returns:
yields
Report
instances
- async create(template_id: int, start_date: date | None = None, end_date: date | None = None, site_list: str | None = None) str [source]
Create a new report. For each templateId, there are a set of validation rules that need to be followed. For example, for templates belonging to Webex, the user needs to provide siteUrl. These validation rules can be retrieved via the Report Templates API.
CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.
- Parameters:
template_id (int) – Unique ID representing valid report templates.
start_date (date) – Data in the report will be from this date onwards.
end_date (date) – Data in the report will be until this date.
site_list (str) – Sites belonging to user’s organization. This attribute is needed for site-based templates.
- Returns:
The unique identifier for the report.
- Return type:
str
- async details(report_id: str) Report [source]
Shows details for a report, by report ID.
Specify the report ID in the reportId parameter in the URI.
CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.
- Parameters:
report_id (str) – The unique identifier for the report.
- Returns:
report details
- Return type:
- async delete(report_id: str)[source]
Remove a report from the system.
Specify the report ID in the reportId parameter in the URI
CSV reports for Teams services are only supported for organizations based in the North American region. Organizations based in a different region will return blank CSV files for any Teams reports.
- Parameters:
report_id (str) – The unique identifier for the report.
- async download(url: str) List[dict] [source]
Download a report from the given URL and yield the rows as dicts
- Parameters:
url (str) – download URL
- Returns:
list of dicts (one per row)
- Return type:
list[dict]
- base = 'devices'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsRestSession(*, tokens: Tokens, concurrent_requests: int)[source]
Bases:
ClientSession
- REST session used for API requests:
includes an Authorization header in reach request
implements retries on 429
loads deserializes JSON data if needed
- BASE = 'https://webexapis.com/v1'
base URL for all Webex API requests
- property access_token: str
access token used for all requests
- Returns:
access token
- Return type:
str
- async rest_get(*args, **kwargs) str | dict [source]
GET request
- Parameters:
args –
kwargs –
- Returns:
deserialized JSON content or body text
- async rest_post(*args, **kwargs) str | dict [source]
POST request
- Parameters:
args –
kwargs –
- Returns:
deserialized JSON content or body text
- async rest_put(*args, **kwargs) str | dict [source]
PUT request
- Parameters:
args –
kwargs –
- Returns:
deserialized JSON content or body text
- async follow_pagination(url: str, model: Type[ApiModel] | None = None, params: dict | None = None, item_key: str | None = None, **kwargs) AsyncGenerator[ApiModel, None, None] [source]
Handling RFC5988 pagination of list requests. Generator of parsed objects
- Parameters:
url (str) – start url for 1st GET
model (ApiModel) – data type to return
params (Optional[dict]) – URL parameters, optional
item_key (str) – key to list of values
- Returns:
yields parsed objects
- class wxc_sdk.as_api.AsRoomTabsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
A Room Tab represents a URL shortcut that is added as a persistent tab to a Webex room (space) tab row. Use this API to list tabs of any Webex room that you belong to. Room Tabs can also be updated to point to a different content URL, or deleted to remove the tab from the room. Just like in the Webex app, you must be a member of the room in order to list its Room Tabs.
- list_tabs_gen(room_id: str, **params) AsyncGenerator[RoomTab, None, None] [source]
Lists all Room Tabs of a room specified by the roomId query parameter.
- Parameters:
room_id (str) – ID of the room for which to list room tabs.
- async list_tabs(room_id: str, **params) List[RoomTab] [source]
Lists all Room Tabs of a room specified by the roomId query parameter.
- Parameters:
room_id (str) – ID of the room for which to list room tabs.
- async create_tab(room_id: str, content_url: str, display_name: str) RoomTab [source]
Add a tab with a specified URL to a room.
- Parameters:
room_id (str) – A unique identifier for the room.
content_url (str) – URL of the Room Tab. Must use https protocol.
display_name (str) – User-friendly name for the room tab.
- async tab_details(tab_id: str) RoomTab [source]
Get details for a Room Tab with the specified room tab ID.
- Parameters:
tab_id (str) – The unique identifier for the Room Tab.
- async update_tab(tab_id: str, room_id: str, content_url: str, display_name: str) RoomTab [source]
Updates the content URL of the specified Room Tab ID.
- Parameters:
tab_id (str) – The unique identifier for the Room Tab.
room_id (str) – ID of the room that contains the room tab in question.
content_url (str) – Content URL of the Room Tab. URL must use https protocol.
display_name (str) – User-friendly name for the room tab.
- async delete_tab(tab_id: str)[source]
Deletes a Room Tab with the specified ID.
- Parameters:
tab_id (str) – The unique identifier for the Room Tab to delete.
- base = 'room/tabs'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsRoomsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Rooms are virtual meeting places where people post messages and collaborate to get work done. This API is used to manage the rooms themselves. Rooms are created and deleted with this API. You can also update a room to change its title, for example. To create a team room, specify the a teamId in the POST payload. Note that once a room is added to a team, it cannot be moved. To learn more about managing teams, see the Teams API. To manage people in a room see the Memberships API. To post content see the Messages API.
- list_gen(team_id: str | None = None, type_: RoomType | None = None, org_public_spaces: bool | None = None, from_: datetime | None = None, to_: datetime | None = None, sort_by: str | None = None, **params) AsyncGenerator[Room, None, None] [source]
List rooms. The title of the room for 1:1 rooms will be the display name of the other person. By default, lists rooms to which the authenticated user belongs. Long result sets will be split into pages. Known Limitations: The underlying database does not support natural sorting by lastactivity and will only sort on limited set of results, which are pulled from the database in order of roomId. For users or bots in more than 3000 spaces this can result in anomalies such as spaces that have had recent activity not being returned in the results when sorting by lastacivity.
- Parameters:
team_id (str) – List rooms associated with a team, by ID.
type (RoomType) – List rooms by type. Possible values: direct, group
org_public_spaces (bool) – Shows the org’s public spaces joined and unjoined. When set the result list is sorted by the madePublic timestamp.
from (datetime) – Filters rooms, that were made public after this time. See madePublic timestamp
to (datetime) – Filters rooms, that were made public before this time. See maePublic timestamp
sort_by (str) – Sort results. Possible values: id, lastactivity, created
- async list(team_id: str | None = None, type_: RoomType | None = None, org_public_spaces: bool | None = None, from_: datetime | None = None, to_: datetime | None = None, sort_by: str | None = None, **params) List[Room] [source]
List rooms. The title of the room for 1:1 rooms will be the display name of the other person. By default, lists rooms to which the authenticated user belongs. Long result sets will be split into pages. Known Limitations: The underlying database does not support natural sorting by lastactivity and will only sort on limited set of results, which are pulled from the database in order of roomId. For users or bots in more than 3000 spaces this can result in anomalies such as spaces that have had recent activity not being returned in the results when sorting by lastacivity.
- Parameters:
team_id (str) – List rooms associated with a team, by ID.
type (RoomType) – List rooms by type. Possible values: direct, group
org_public_spaces (bool) – Shows the org’s public spaces joined and unjoined. When set the result list is sorted by the madePublic timestamp.
from (datetime) – Filters rooms, that were made public after this time. See madePublic timestamp
to (datetime) – Filters rooms, that were made public before this time. See maePublic timestamp
sort_by (str) – Sort results. Possible values: id, lastactivity, created
- async create(title: str, team_id: str | None = None, classification_id: str | None = None, is_locked: bool | None = None, is_public: bool | None = None, description: str | None = None, is_announcement_only: bool | None = None) Room [source]
Creates a room. The authenticated user is automatically added as a member of the room. See the Memberships API to learn how to add more people to the room.
To create a 1:1 room, use the Create Messages endpoint to send a message directly to another person by using the toPersonId or toPersonEmail parameters. Bots are not able to create and simultaneously classify a room. A bot may update a space classification after a person of the same owning organization joined the space as the first human user.
A space can only be put into announcement mode when it is locked.
- Parameters:
title (str) – A user-friendly name for the room.
team_id (str) – The ID for the team with which this room is associated.
classification_id (str) – The classificationId for the room.
is_locked (bool) – Set the space as locked/moderated and the creator becomes a moderator
is_public (bool) – The room is public and therefore discoverable within the org. Anyone can find and join that room. When true the description must be filled in.
description (str) – The description of the space.
is_announcement_only (bool) – Sets the space into announcement Mode.
- async details(room_id: str) Room [source]
Shows details for a room, by ID. The title of the room for 1:1 rooms will be the display name of the other person. Specify the room ID in the roomId parameter in the URI.
- Parameters:
room_id (str) – The unique identifier for the room.
- async meeting_details(room_id: str) GetRoomMeetingDetailsResponse [source]
Shows Webex meeting details for a room such as the SIP address, meeting URL, toll-free and toll dial-in numbers. Specify the room ID in the roomId parameter in the URI.
- Parameters:
room_id (str) – The unique identifier for the room.
- async update(update: Room) Room [source]
Updates details for a room, by ID.
Specify the room ID in the roomId parameter in the URI.
A space can only be put into announcement mode when it is locked.
Any space participant or compliance officer can convert a space from public to private. Only a compliance officer can convert a space from private to public and only if the space is classified with the lowest category (usually public), and the space has a description.
To remove a description please use a space character by itself.
- Update:
update to apply. ID and title have to be set. Only can update:
title: str: A user-friendly name for the room.
classification_id: str: The classificationId for the room.
team_id: str: The teamId to which this space should be assigned. Only unowned spaces can be assigned to a team. Assignment between teams is unsupported.
is_locked: bool: Set the space as locked/moderated and the creator becomes a moderator
is_announcement_only: bool: Sets the space into announcement mode or clears the anouncement Mode (false)
is_read_only: bool: A compliance officer can set a direct room as read-only, which will disallow any new information exchanges in this space, while maintaining historical data.
- async delete(room_id: str)[source]
Deletes a room, by ID. Deleted rooms cannot be recovered. As a security measure to prevent accidental deletion, when a non moderator deletes the room they are removed from the room instead. Deleting a room that is part of a team will archive the room instead. Specify the room ID in the roomId parameter in the URI.
- Parameters:
room_id (str) – The unique identifier for the room.
- base = 'rooms'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsRouteGroupApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for everything route groups
- list_gen(name: str | None = None, order: str | None = None, org_id: str | None = None, **params) AsyncGenerator[RouteGroup, None, None] [source]
List all Route Groups for an organization. A Route Group is a group of trunks that allows further scale and redundancy with the connection to the premises.
Retrieving this route group list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (st) – Return the list of route groups matching the route group name.
order (str) – Order the route groups according to designated fields. Available sort orders: asc, desc.
org_id (str) – List route groups for this organization.
- Returns:
generator of
RouteGroup
instances
- async list(name: str | None = None, order: str | None = None, org_id: str | None = None, **params) List[RouteGroup] [source]
List all Route Groups for an organization. A Route Group is a group of trunks that allows further scale and redundancy with the connection to the premises.
Retrieving this route group list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (st) – Return the list of route groups matching the route group name.
order (str) – Order the route groups according to designated fields. Available sort orders: asc, desc.
org_id (str) – List route groups for this organization.
- Returns:
generator of
RouteGroup
instances
- async create(route_group: RouteGroup, org_id: str | None = None) str [source]
Creates a Route Group for the organization.
A Route Group is a collection of trunks that allows further scale and redundancy with the connection to the premises. Route groups can include up to 10 trunks from different locations.
Creating a Route Group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
route_group (
RouteGroup
) –settings for new route group. name and local_gateways need to be set. For each LGW id and priority need to be set. Example:
rg = RouteGroup(name=rg_name, local_gateways=[RGTrunk(trunk_id=trunk.trunk_id, priority=1)]) rg_id = api.telephony.prem_pstn.route_group.create(route_group=rg)
org_id (str) –
- Returns:
id of new route group
- Return type:
str
- async details(rg_id: str, org_id: str | None = None) RouteGroup [source]
Reads a Route Group for the organization based on id.
A Route Group is a collection of trunks that allows further scale and redundancy with the connection to the premises. Route groups can include up to 10 trunks from different locations.
Reading a Route Group requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id (str) – Route Group for which details are being requested.
org_id (str) – Organization of the Route Group.
- Returns:
route group details
- Return type:
RouteGroup
- async update(rg_id: str, update: RouteGroup, org_id: str | None = None)[source]
Modifies an existing Route Group for an organization based on id.
A Route Group is a collection of trunks that allows further scale and redundancy with the connection to the premises. Route groups can include up to 10 trunks from different locations.
Modifying a Route Group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rg_id (str) – route group to be modified
update (
RouteGroup
) – new settingsorg_id (str) – Organization of the Route Group.
- async delete_route_group(rg_id: str, org_id: str | None = None)[source]
Remove a Route Group from an Organization based on id.
A Route Group is a collection of trunks that allows further scale and redundancy with the connection to the premises. Route groups can include up to 10 trunks from different locations.
Removing a Route Group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rg_id (str) – Route Group to be deleted
org_id (str) – Organization of the Route Group.
- async usage(rg_id: str, org_id: str | None = None) RouteGroupUsage [source]
List the number of “Call to” on-premises Extensions, Dial Plans, PSTN Connections, and Route Lists used by a specific Route Group. Users within Call to Extension locations are registered to a PBX which allows you to route unknown extensions (calling number length of 2-6 digits) to the PBX using an existing Trunk or Route Group. PSTN Connections may be cisco PSTN, cloud-connected PSTN, or premises-based PSTN (local gateway). Dial Plans allow you to route calls to on-premises extensions via your trunk or route group. Route Lists are a list of numbers that can be reached via a route group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving usage information requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id (str) – Route group requested for information.
org_id (str) – Organization associated with specific route group
- Returns:
usage information
- Return type:
RouteGroupUsage
- usage_call_to_extension_gen(rg_id: str, org_id: str | None = None, **params) AsyncGenerator[IdAndName, None, None] [source]
List “Call to” on-premises Extension Locations for a specific route group. Users within these locations are registered to a PBX which allows you to route unknown extensions (calling number length of 2-6 digits) to the PBX using an existing trunk or route group.
Retrieving this location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- async usage_call_to_extension(rg_id: str, org_id: str | None = None, **params) List[IdAndName] [source]
List “Call to” on-premises Extension Locations for a specific route group. Users within these locations are registered to a PBX which allows you to route unknown extensions (calling number length of 2-6 digits) to the PBX using an existing trunk or route group.
Retrieving this location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- usage_dial_plan_gen(rg_id: str, org_id: str | None = None, **params) AsyncGenerator[IdAndName, None, None] [source]
List Dial Plan Locations for a specific route group.
Dial Plans allow you to route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A Dial Plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Retrieving this location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- async usage_dial_plan(rg_id: str, org_id: str | None = None, **params) List[IdAndName] [source]
List Dial Plan Locations for a specific route group.
Dial Plans allow you to route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A Dial Plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Retrieving this location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- usage_location_pstn_gen(rg_id: str, org_id: str | None = None, **params) AsyncGenerator[IdAndName, None, None] [source]
List PSTN Connection Locations for a specific route group. This solution lets you configure users to use Cloud PSTN (CCP or Cisco PSTN) or Premises-based PSTN.
Retrieving this Location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- async usage_location_pstn(rg_id: str, org_id: str | None = None, **params) List[IdAndName] [source]
List PSTN Connection Locations for a specific route group. This solution lets you configure users to use Cloud PSTN (CCP or Cisco PSTN) or Premises-based PSTN.
Retrieving this Location list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- usage_route_lists_gen(rg_id: str, org_id: str | None = None, **params) AsyncGenerator[UsageRouteLists, None, None] [source]
List Route Lists for a specific route group. Route Lists are a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving this list of Route Lists requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- async usage_route_lists(rg_id: str, org_id: str | None = None, **params) List[UsageRouteLists] [source]
List Route Lists for a specific route group. Route Lists are a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving this list of Route Lists requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rg_id – Route group requested for information.
org_id – Organization associated with specific route group.
- Returns:
generator of instances
- Return type:
- base = 'telephony/config/premisePstn/routeGroups'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsRouteListApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for everything route lists
- list_gen(name: list[str] | None = None, location_id: list[str] | None = None, order: str | None = None, org_id: str | None = None, **params) AsyncGenerator[RouteList, None, None] [source]
List all Route Lists for the organization.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving the Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (str) – Return the list of Route List matching the route list name.
location_id (str) – Return the list of Route Lists matching the location id.
order (str) – Order the Route List according to the designated fields.Available sort fields: name, locationId. Sort order is ascending by default
org_id (str) – List all Route List for this organization.
- Returns:
generator yielding
RouteList
instances
- async list(name: list[str] | None = None, location_id: list[str] | None = None, order: str | None = None, org_id: str | None = None, **params) List[RouteList] [source]
List all Route Lists for the organization.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving the Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (str) – Return the list of Route List matching the route list name.
location_id (str) – Return the list of Route Lists matching the location id.
order (str) – Order the Route List according to the designated fields.Available sort fields: name, locationId. Sort order is ascending by default
org_id (str) – List all Route List for this organization.
- Returns:
generator yielding
RouteList
instances
- async create(name: str, location_id: str, rg_id: str, org_id: str | None = None) str [source]
Create a Route List for the organization.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Creating a Route List requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
name (str) – Name of the Route List
location_id (str) – Location associated with the Route List.
rg_id (str) – UUID of the route group associated with Route List.
org_id (str) – Organization to which Route List belongs.
- Returns:
ID of the newly route list created.
- Return type:
str
- async details(rl_id: str, org_id: str | None = None) RouteListDetail [source]
Get Route List Details.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving a Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
rl_id (str) – ID of the Route List.
org_id (str) – Organization to which Route List belongs.
- Returns:
route list details
- Return type:
RouteListDetail
- async update(rl_id: str, name: str, rg_id: str, org_id: str | None = None)[source]
Modify the details for a Route List.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving a Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rl_id (str) – ID of the Route List.
name (str) – Route List new name.
rg_id (str) – New route group id.
org_id (str) – Organization to which Route List belongs.
- async delete_route_list(rl_id: str, org_id: str | None = None)[source]
Delete Route List for a Customer
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Deleting a Route List requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rl_id (str) – ID of the Route List.
org_id (str) – Organization to which Route List belongs.
- numbers_gen(rl_id: str, order: str | None = None, number: str | None = None, org_id: str | None = None, **params) AsyncGenerator[str, None, None] [source]
Get numbers assigned to a Route List
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving a Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rl_id (str) – ID of the Route List.
order (str) – Order the Route Lists according to number.
number (str) – Number assigned to the route list.
org_id (str) – Organization to which Route List belongs.
- Returns:
generator yielding str
- async numbers(rl_id: str, order: str | None = None, number: str | None = None, org_id: str | None = None, **params) List[str] [source]
Get numbers assigned to a Route List
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving a Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rl_id (str) – ID of the Route List.
order (str) – Order the Route Lists according to number.
number (str) – Number assigned to the route list.
org_id (str) – Organization to which Route List belongs.
- Returns:
generator yielding str
- async update_numbers(rl_id: str, numbers: List[NumberAndAction], org_id: str | None = None) List[UpdateNumbersResponse] [source]
Modify numbers for a specific Route List of a Customer.
A Route List is a list of numbers that can be reached via a Route Group. It can be used to provide cloud PSTN connectivity to Webex Calling Dedicated Instance.
Retrieving a Route List requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
rl_id (str) – ID of the Route List.
numbers (list[
NumberAndAction
]) – Array of the numbers to be deleted/added.org_id (str) – Organization to which Route List belongs.
- Returns:
list of update number status
- Return type:
list[
UpdateNumbersResponse
]
- base = 'telephony/config/premisePstn/routeLists'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsScheduleApi(*, session: AsRestSession, base: ScheduleApiBase)[source]
Bases:
AsApiChild
Schedules API
- list_gen(obj_id: str, org_id: str | None = None, schedule_type: ScheduleType | None = None, name: str | None = None, **params) AsyncGenerator[Schedule, None, None] [source]
List of Schedules for a Person or location
List schedules for a person or location in an organization.
Schedules are used to support calling features and can be defined at the location or person level. businessHours schedules allow you to apply specific call settings at different times of the day or week by defining one or more events. holidays schedules define exceptions to normal business hours by defining one or more events.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- Parameters:
obj_id (str) – Return the list of schedules for this location or user
org_id (str) – List schedules for this organization.
schedule_type – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
name – Only return schedules with the matching name.
- Returns:
yields schedules
- async list(obj_id: str, org_id: str | None = None, schedule_type: ScheduleType | None = None, name: str | None = None, **params) List[Schedule] [source]
List of Schedules for a Person or location
List schedules for a person or location in an organization.
Schedules are used to support calling features and can be defined at the location or person level. businessHours schedules allow you to apply specific call settings at different times of the day or week by defining one or more events. holidays schedules define exceptions to normal business hours by defining one or more events.
This API requires a full, user, or read-only administrator auth token with a scope of spark-admin:people_read.
- Parameters:
obj_id (str) – Return the list of schedules for this location or user
org_id (str) – List schedules for this organization.
schedule_type – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
name – Only return schedules with the matching name.
- Returns:
yields schedules
- async details(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, org_id: str | None = None) Schedule [source]
Get Details for a Schedule
Retrieve Schedule details.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Retrieving schedule details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
obj_id (str) – Retrieve schedule details in this location or user
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Retrieve the schedule with the matching ID.
org_id (str) – Retrieve schedule details from this organization.
- Returns:
- async create(obj_id: str, schedule: Schedule, org_id: str | None = None) str [source]
Create a Schedule
Create new Schedule for the given location.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Creating a schedule requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
obj_id (str) – Create the schedule for this location or user
schedule (Schedule) – Schedule to be created
org_id (str) – Create the schedule for this organization.
- Returns:
ID of the newly created schedule.
- Return type:
str
- async update(obj_id: str, schedule: Schedule, schedule_type: str | ScheduleType | None = None, schedule_id: str | None = None, org_id: str | None = None) str [source]
Update a Schedule
Update the designated Schedule.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Updating a schedule requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Schedule ID will change upon modification of the Schedule name
- Parameters:
obj_id (str) – Location or user for which this schedule exists
schedule (Schedule) – data for the update
schedule_type (ScheduleTypeOrStr) – Type of the schedule. Default: schedule_type from schedule businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Update schedule with the matching ID. Default: schedule_id from schedule
org_id (str) – Update schedule from this organization.
- Returns:
schedule id
- async delete_schedule(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, org_id: str | None = None)[source]
Delete a Schedule
Delete the designated Schedule.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Deleting a schedule requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
obj_id (str) – Location or user from which to delete a schedule.
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Delete the schedule with the matching ID.
org_id (str) – Retrieve schedule details from this organization.
- Returns:
- async event_details(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, event_id: str, org_id: str | None = None) Event [source]
Get Details for a Schedule Event
Retrieve Schedule Event details.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Retrieving schedule event details requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
obj_id (str) – Retrieve schedule event details for this location or user
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Retrieve schedule event details for schedule with the matching ID.
event_id (str) – Retrieve the schedule event with the matching schedule event ID.
org_id (str) – Retrieve schedule event details from this organization.
- Returns:
- async event_create(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, event: Event, org_id: str | None = None) str [source]
Create a Schedule Event
Create new Event for the given location or user Schedule.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Creating a schedule event requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
obj_id (str) – Create the schedule for this location.
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Create event for a given schedule ID.
event (Event) – event data
org_id (str) – Retrieve schedule event details from this organization.
- Returns:
event id
- Return type:
str
- async event_update(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, event: Event, event_id: str | None = None, org_id: str | None = None) str [source]
Update a Schedule Event
Update the designated Schedule Event.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Updating a schedule event requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
NOTE: The Schedule Event ID will change upon modification of the Schedule event name.
- Parameters:
obj_id (str) – Location or user for which this schedule event exists.
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Update schedule event with the matching schedule ID.
event (Event) – update settings
event_id (str) – Update the schedule event with the matching schedule event ID. Default: event id from event
org_id (str) – Update schedule from this organization.
- Returns:
event id; changed if name changed
- async event_delete(obj_id: str, schedule_type: str | ScheduleType, schedule_id: str, event_id: str, org_id: str | None = None)[source]
Delete a Schedule Event
Delete the designated Schedule Event.
A time schedule establishes a set of times during the day or holidays in the year in which a feature, for example auto attendants, can perform a specific action.
Deleting a schedule event requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
obj_id (str) – Location or user from which to delete a schedule.
schedule_type (ScheduleTypeOrStr) – Type of the schedule. businessHours - Business hours schedule type. holidays - Holidays schedule type.
schedule_id (str) – Delete schedule event with the matching schedule ID.
event_id (str) – Delete the schedule event with the matching schedule event ID. Default: event id from event
org_id (str) – Delete schedule from this organization.
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsTeamMembershipsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Team Memberships represent a person’s relationship to a team. Use this API to list members of any team that you’re in or create memberships to invite someone to a team. Team memberships can also be updated to make someone a moderator or deleted to remove them from the team. Just like in the Webex app, you must be a member of the team in order to list its memberships or invite people.
- list_gen(team_id: str, **params) AsyncGenerator[TeamMembership, None, None] [source]
Lists all team memberships for a given team, specified by the teamId query parameter. Use query parameters to filter the response.
- Parameters:
team_id (str) – List memberships for a team, by ID.
- async list(team_id: str, **params) List[TeamMembership] [source]
Lists all team memberships for a given team, specified by the teamId query parameter. Use query parameters to filter the response.
- Parameters:
team_id (str) – List memberships for a team, by ID.
- async create(team_id: str, person_id: str | None = None, person_email: str | None = None, is_moderator: bool | None = None) TeamMembership [source]
Add someone to a team by Person ID or email address, optionally making them a moderator.
- Parameters:
team_id (str) – The team ID.
person_id (str) – The person ID.
person_email (str) – The email address of the person.
is_moderator (bool) – Whether or not the participant is a team moderator.
- async details(membership_id: str) TeamMembership [source]
Shows details for a team membership, by ID. Specify the team membership ID in the membershipId URI parameter.
- Parameters:
membership_id (str) – The unique identifier for the team membership.
- async membership(membership_id: str, is_moderator: bool) TeamMembership [source]
Updates a team membership, by ID. Specify the team membership ID in the membershipId URI parameter.
- Parameters:
membership_id (str) – The unique identifier for the team membership.
is_moderator (bool) – Whether or not the participant is a team moderator.
- async delete(membership_id: str)[source]
Deletes a team membership, by ID. Specify the team membership ID in the membershipId URI parameter. The team membership for the last moderator of a team may not be deleted; promote another user to team moderator first.
- Parameters:
membership_id (str) – The unique identifier for the team membership.
- base = 'team/memberships'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsTeamsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Teams are groups of people with a set of rooms that are visible to all members of that team. This API is used to manage the teams themselves. Teams are created and deleted with this API. You can also update a team to change its name, for example. To manage people in a team see the Team Memberships API. To manage team rooms see the Rooms API.
- list_gen() AsyncGenerator[Team, None, None] [source]
Lists teams to which the authenticated user belongs.
- async create(name: str) Team [source]
Creates a team. The authenticated user is automatically added as a member of the team. See the Team Memberships API to learn how to add more people to the team.
- Parameters:
name (str) – A user-friendly name for the team.
- async details(team_id: str) Team [source]
Shows details for a team, by ID. Specify the team ID in the teamId parameter in the URI.
- Parameters:
team_id (str) – The unique identifier for the team.
- async update(team_id: str, name: str) Team [source]
Updates details for a team, by ID. Specify the team ID in the teamId parameter in the URI.
- Parameters:
team_id (str) – The unique identifier for the team.
name (str) – A user-friendly name for the team.
- async delete(team_id: str)[source]
Deletes a team, by ID. Specify the team ID in the teamId parameter in the URI.
- Parameters:
team_id (str) – The unique identifier for the team.
- base = 'teams'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsTelephonyApi(session: AsRestSession)[source]
Bases:
AsApiChild
The telephony settings (features) API.
- access_codes: AsAccessCodesApi
access or authentication codes
- auto_attendant: AsAutoAttendantApi
- call_intercept: AsLocationInterceptApi
location call intercept settings
- calls: AsCallsApi
- callpark: AsCallParkApi
- callpark_extension: AsCallparkExtensionApi
- callqueue: AsCallQueueApi
- devices: AsTelephonyDevicesApi
WxC device operations
- huntgroup: AsHuntGroupApi
- location: AsTelephonyLocationApi
location specific settings
- organisation_voicemail: AsOrganisationVoicemailSettingsAPI
organisation voicemail settings
- paging: AsPagingApi
- permissions_out: AsOutgoingPermissionsApi
- pickup: AsCallPickupApi
- prem_pstn: AsPremisePstnApi
- schedules: AsScheduleApi
- voicemail_groups: AsVoicemailGroupsApi
- voicemail_rules: AsVoicemailRulesApi
- voice_messaging: AsVoiceMessagingApi
- voiceportal: AsVoicePortalApi
- phone_numbers_gen(location_id: str | None = None, phone_number: str | None = None, available: bool | None = None, order: str | None = None, owner_name: str | None = None, owner_id: str | None = None, owner_type: OwnerType | None = None, extension: str | None = None, number_type: NumberType | None = None, phone_number_type: NumberListPhoneNumberType | None = None, state: NumberState | None = None, details: bool | None = None, toll_free_numbers: bool | None = None, restricted_non_geo_numbers: bool | None = None, org_id: str | None = None, **params) AsyncGenerator[NumberListPhoneNumber, None, None] [source]
Get Phone Numbers for an Organization with given criteria.
List all the phone numbers for the given organization along with the status and owner (if any).
PSTN phone numbers are associated with a specific location and can be active/inactive and assigned/unassigned. The owner is the person, workspace, or feature to which the number is assigned. Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the list of phone numbers for this location within the given organization.
phone_number (str) – Search for this phone number.
available (bool) – Search among the available phone numbers. This parameter cannot be used along with owner_type parameter when set to true.
order (str) – Sort the list of phone numbers based on the following:lastName,dn,extension. Default sort will be based on number and extension in an Ascending order
owner_name (str) – Return the list of phone numbers that is owned by given owner name. Maximum length is 255.
owner_id (str) – Returns only the matched number/extension entries assigned to the feature with specified uuid/broadsoftId.
owner_type (OwnerType) – Returns the list of phone numbers that are of given owner_type.
extension (str) – Returns the list of PSTN phone numbers with given extension.
number_type (NumberType) – Returns the filtered list of PSTN phone numbers that contains given type of numbers. This parameter cannot be used along with available or state.
phone_number_type (NumberListPhoneNumberType) – Returns the filtered list of PSTN phone numbers that are of given phoneNumberType.
state (NumberState) – Returns the list of PSTN phone numbers with matching state.
details (bool) – Returns the overall count of the PSTN phone numbers along with other details for given organization.
toll_free_numbers (bool) – Returns the list of toll free phone numbers.
restricted_non_geo_numbers (bool) – Returns the list of restricted non geographical numbers.
org_id (str) – List numbers for this organization.
- Returns:
yields
NumberListPhoneNumber
instances
- async phone_numbers(location_id: str | None = None, phone_number: str | None = None, available: bool | None = None, order: str | None = None, owner_name: str | None = None, owner_id: str | None = None, owner_type: OwnerType | None = None, extension: str | None = None, number_type: NumberType | None = None, phone_number_type: NumberListPhoneNumberType | None = None, state: NumberState | None = None, details: bool | None = None, toll_free_numbers: bool | None = None, restricted_non_geo_numbers: bool | None = None, org_id: str | None = None, **params) List[NumberListPhoneNumber] [source]
Get Phone Numbers for an Organization with given criteria.
List all the phone numbers for the given organization along with the status and owner (if any).
PSTN phone numbers are associated with a specific location and can be active/inactive and assigned/unassigned. The owner is the person, workspace, or feature to which the number is assigned. Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Return the list of phone numbers for this location within the given organization.
phone_number (str) – Search for this phone number.
available (bool) – Search among the available phone numbers. This parameter cannot be used along with owner_type parameter when set to true.
order (str) – Sort the list of phone numbers based on the following:lastName,dn,extension. Default sort will be based on number and extension in an Ascending order
owner_name (str) – Return the list of phone numbers that is owned by given owner name. Maximum length is 255.
owner_id (str) – Returns only the matched number/extension entries assigned to the feature with specified uuid/broadsoftId.
owner_type (OwnerType) – Returns the list of phone numbers that are of given owner_type.
extension (str) – Returns the list of PSTN phone numbers with given extension.
number_type (NumberType) – Returns the filtered list of PSTN phone numbers that contains given type of numbers. This parameter cannot be used along with available or state.
phone_number_type (NumberListPhoneNumberType) – Returns the filtered list of PSTN phone numbers that are of given phoneNumberType.
state (NumberState) – Returns the list of PSTN phone numbers with matching state.
details (bool) – Returns the overall count of the PSTN phone numbers along with other details for given organization.
toll_free_numbers (bool) – Returns the list of toll free phone numbers.
restricted_non_geo_numbers (bool) – Returns the list of restricted non geographical numbers.
org_id (str) – List numbers for this organization.
- Returns:
yields
NumberListPhoneNumber
instances
- async phone_number_details(org_id: str | None = None) NumberDetails [source]
get summary (counts) of phone numbers
- Parameters:
org_id (str) – detaild for numbers in this organization.
- Returns:
phone number details
- Return type:
NumberDetails
- async validate_extensions(extensions: list[str]) ValidateExtensionsResponse [source]
Validate the List of Extensions
Validate the List of Extensions. Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
extensions (list[str]) – Array of Strings of ID of Extensions.
- Returns:
validation response
- Return type:
- async validate_phone_numbers(phone_numbers: list[str], org_id: str | None = None) ValidatePhoneNumbersResponse [source]
Validate the list of phone numbers in an organization. Each phone number’s availability is indicated in the response.
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.
Validating a phone number in an organization requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
phone_numbers (list[str]) – List of phone numbers to be validated.
org_id (str) – Organization of the Route Group.
- Returns:
validation result
- Return type:
- async ucm_profiles(org_id: str | None = None) list[wxc_sdk.telephony.UCMProfile] [source]
Read the List of UC Manager Profiles
List all calling UC Manager Profiles for the organization.
UC Manager Profiles are applicable if your organization uses Jabber in Team Messaging mode or Calling in Webex Teams (Unified CM).
The UC Manager Profile has an organization-wide default and may be overridden for individual persons, although currently only setting at a user level is supported by Webex APIs.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:people_read as this API is designed to be used in conjunction with calling behavior at the user level.
- Parameters:
org_id (str) – List manager profiles in this organization.
- Returns:
list of
UCMProfile
- route_choices_gen(route_group_name: str | None = None, trunk_name: str | None = None, order: str | None = None, org_id: str | None = None) AsyncGenerator[RouteIdentity, None, None] [source]
List all Routes for the organization.
Trunk and Route Group qualify as Route. Trunks and Route Groups provide you the ability to configure Webex Calling to manage calls between Webex Calling hosted users and premises PBX(s) users. This solution lets you configure users to use Cloud PSTN (CCP or Cisco PSTN) or Premises-based PSTN.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
route_group_name – Return the list of route identities matching the route group name.
trunk_name – Return the list of route identities matching the trunk name.
order – Order the route identities according to the designated fields. Available sort fields: routeName, routeType.
org_id – List route identities for this organization.
- Returns:
- async route_choices(route_group_name: str | None = None, trunk_name: str | None = None, order: str | None = None, org_id: str | None = None) List[RouteIdentity] [source]
List all Routes for the organization.
Trunk and Route Group qualify as Route. Trunks and Route Groups provide you the ability to configure Webex Calling to manage calls between Webex Calling hosted users and premises PBX(s) users. This solution lets you configure users to use Cloud PSTN (CCP or Cisco PSTN) or Premises-based PSTN.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
route_group_name – Return the list of route identities matching the route group name.
trunk_name – Return the list of route identities matching the trunk name.
order – Order the route identities according to the designated fields. Available sort fields: routeName, routeType.
org_id – List route identities for this organization.
- Returns:
- async test_call_routing(originator_id: str, originator_type: OriginatorType, destination: str, originator_number: str | None = None, org_id: str | None = None) TestCallRoutingResult [source]
Validates that an incoming call can be routed.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Test call routing requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
originator_id (str) – This element is used to identify the originating party. It can be user UUID or trunk UUID.
originator_type (
OriginatorType
) –destination (str) – This element specifies called party. It can be any dialable string, for example, an ESN number, E.164 number, hosted user DN, extension, extension with location code, URL, FAC code.
originator_number (str) – Only used when originatorType is TRUNK. This element could be a phone number or URI.
org_id (str) – Organization in which we are validating a call routing.
- Returns:
call routing test result
- Return type:
TestCallRoutingResult
- async supported_devices(org_id: str | None = None) list[wxc_sdk.telephony.SupportedDevice] [source]
Gets the list of supported devices for an organization location.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id – List supported devices for an organization
- Returns:
List of supported devices
- async device_settings(org_id: str | None = None) DeviceCustomization [source]
Get device override settings for an organization.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – List supported devices for an organization location.
- Returns:
device customization response
- Return type:
- base = 'telephony/config'
- class wxc_sdk.as_api.AsTelephonyDevicesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Telephony devices API
- async members(device_id: str, org_id: str | None = None) DeviceMembersResponse [source]
Get Device Members
Get the list of all the members of the device including primary and secondary users.
A device member can be either a person or a workspace. An admin can access the list of member details, modify member details and search for available members on a device.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
device_id (str) – Unique identifier for the device.
org_id (str) – Retrieves the list of all members of the device in this Organization.
- Returns:
Device model, line count, and members
- Return type:
- async update_members(device_id: str, members: list[Union[wxc_sdk.telephony.devices.DeviceMember, wxc_sdk.telephony.devices.AvailableMember]] | None, org_id: str | None = None)[source]
Modify member details on the device.
A device member can be either a person or a workspace. An admin can access the list of member details, modify member details and search for available members on a device.
Modifying members on the device requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
device_id (str) – Unique identifier for the device.
members (list[Union[DeviceMember, AvailableMember]) – New member details for the device. If the member’s list is missing then all the users are removed except the primary user.
org_id (str) – Modify members on the device in this organization.
- available_members_gen(device_id: str, location_id: str, member_name: str | None = None, phone_number: str | None = None, extension: str | None = None, org_id: str | None = None, **params) AsyncGenerator[AvailableMember, None, None] [source]
Search members that can be assigned to the device.
A device member can be either a person or a workspace. A admin can access the list of member details, modify member details and search for available members on a device.
This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
device_id (str) – Unique identifier for the device.
location_id (str) – Search (Contains) based on number.
member_name (str) – Search (Contains) numbers based on member name.
phone_number (str) – Search (Contains) based on number.
extension (str) – Search (Contains) based on extension.
org_id (str) – Retrieves the list of available members on the device in this Organization.
- Returns:
list of available members
- async available_members(device_id: str, location_id: str, member_name: str | None = None, phone_number: str | None = None, extension: str | None = None, org_id: str | None = None, **params) List[AvailableMember] [source]
Search members that can be assigned to the device.
A device member can be either a person or a workspace. A admin can access the list of member details, modify member details and search for available members on a device.
This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
device_id (str) – Unique identifier for the device.
location_id (str) – Search (Contains) based on number.
member_name (str) – Search (Contains) numbers based on member name.
phone_number (str) – Search (Contains) based on number.
extension (str) – Search (Contains) based on extension.
org_id (str) – Retrieves the list of available members on the device in this Organization.
- Returns:
list of available members
- async apply_changes(device_id: str, org_id: str | None = None)[source]
Apply Changes for a specific device
Issues request to the device to download and apply changes to the configuration.
Applying changes for a specific device requires a full administrator auth token with a scope of spark-admin:telephony_config_write. :param device_id: Unique identifier for the device. :type device_id: str :param org_id: Apply changes for a device in this Organization. :type org_id: str
- async device_settings(device_id: str, device_model: str, org_id: str | None = None) DeviceCustomization [source]
Get override settings for a device.
Device settings lists all the applicable settings for an MPP and an ATA devices at the device level. An admin can also modify the settings. DECT devices do not support settings at the device level.
This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
device_id (str) – Unique identifier for the device.
device_model (str) – Model type of the device.
org_id (str) – Settings on the device in this organization.
- Returns:
Device settings
- Return type:
- async update_device_settings(device_id: str, device_model: str, customization: DeviceCustomization, org_id: str | None = None)[source]
Modify override settings for a device.
Device settings list all the applicable settings for an MPP and an ATA devices at the device level. Admins can also modify the settings. NOTE: DECT devices do not support settings at the device level.
Updating settings on the device requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
device_id (str) – Unique identifier for the device.
device_model (str) – Device model name.
customization (DeviceCustomization) – Indicates the customization object of the device settings.
org_id (str) – Organization in which the device resides..
Example :
# target_device is a TelephonyDevice object target_device: TelephonyDevice # get device level settings settings = api.telephony.devices.device_settings(device_id=target_device.device_id, device_model=target_device.model) # update settings (display name format) and enable device level customization settings.customizations.mpp.display_name_format = DisplayNameSelection.person_last_then_first_name settings.custom_enabled = True # update the device level settings api.telephony.devices.update_device_settings(device_id=target_device.device_id, device_model=target_device.model, customization=settings) # apply changes to device api.telephony.devices.apply_changes(device_id=target_device.device_id)
- async dect_devices(org_id: str | None = None) list[wxc_sdk.telephony.devices.DectDevice] [source]
Read the DECT device type list
Get DECT device type list with base stations and line ports supported count. This is a static list.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id –
- Returns:
- async validate_macs(macs: list[str], org_id: str | None = None) MACValidationResponse [source]
Validate a list of MAC addresses.
Validating this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
macs (list[str]) – MAC addresses to be validated.
org_id (str) – Validate the mac address(es) for this organization.
- Returns:
validation response
- Return type:
MACValidationResponse
- base = 'telephony/config/devices'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsTelephonyLocationApi(session: AsRestSession)[source]
Bases:
AsApiChild
- intercept: AsLocationInterceptApi
call intercept settings
- internal_dialing: AsInternalDialingApi
internal dialing settings
- moh: AsLocationMoHApi
moh settings
- number: AsLocationNumbersApi
number settings
- voicemail: AsLocationVoicemailSettingsApi
Location VM settings (only enable/disable transcription for now)
- receptionist_contacts_directory: AsReceptionistContactsDirectoryApi
Receptionist contacts directories
- async generate_password(location_id: str, generate: list[str] | None = None, org_id: str | None = None)[source]
Generates an example password using the effective password settings for the location. If you don’t specify anything in the generate field or don’t provide a request body, then you will receive a SIP password by default.
It’s used while creating a trunk and shouldn’t be used anywhere else.
Generating an example password requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location for which example password has to be generated.
generate (list[str]) – password settings array.
org_id (str) – Organization to which location belongs.
- Returns:
new password
- Return type:
str
- async validate_extensions(location_id: str, extensions: list[str], org_id: str | None = None) ValidateExtensionsResponse [source]
Validate extensions for a specific location.
Validating extensions requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Validate extensions for this location.
extensions (list[str]) – Array of extensions that will be validated.
org_id (str) – Validate extensions for this organization.
- Returns:
Validation result
- Return type:
- async details(location_id: str, org_id: str | None = None) TelephonyLocation [source]
Shows Webex Calling details for a location, by ID.
Specify the location ID in the locationId parameter in the URI.
Searching and viewing location in your organization requires an administrator auth token with the spark-admin:telephony_config_read scope.
- Parameters:
location_id (str) – Retrieve Webex Calling location attributes for this location.
org_id (str) – Retrieve Webex Calling location attributes for this organization.
- Returns:
Webex Calling details for location
- Return type:
TelephonyLocation
- async update(location_id: str, settings: TelephonyLocation, org_id: str | None = None)[source]
Update Webex Calling details for a location, by ID.
Specify the location ID in the locationId parameter in the URI.
Modifying the connection via API is only supported for the local PSTN types of TRUNK and ROUTE_GROUP.
Updating a location in your organization requires an administrator auth token with the spark-admin:telephony_config_write scope.
Example :
api.telephony.location.update(location_id=location_id, settings=TelephonyLocation( calling_line_id=CallingLineId( phone_number=tn), routing_prefix=routing_prefix, outside_dial_digit='9'))
- Parameters:
location_id (str) – Updating Webex Calling location attributes for this location.
settings (
TelephonyLocation
) – settings to updateorg_id (str) – Updating Webex Calling location attributes for this organization.
- Returns:
- async change_announcement_language(location_id: str, language_code: str, agent_enabled: bool | None = None, service_enabled: bool | None = None, org_id: str | None = None)[source]
Change Announcement Language
Change announcement language for the given location.
Change announcement language for current people/workspaces and/or existing feature configurations. This does not change the default announcement language which is applied to new users/workspaces and new feature configurations.
Changing announcement language for the given location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Change announcement language for this location.
language_code (str) – Language code.
agent_enabled (bool) – Set to true to change announcement language for existing people and workspaces.
service_enabled (bool) – Set to true to change announcement language for existing feature configurations.
org_id (str) – Change announcement language for this organization.
- async device_settings(location_id: str, org_id: str | None = None) DeviceCustomization [source]
Get device override settings for a location.
This requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Unique identifier for the location
org_id (str) – Settings on the device in this organization
- Returns:
device customization response
- Return type:
- base = 'telephony/config/locations'
- class wxc_sdk.as_api.AsTransferNumbersApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for outgoing permission auto transfer numbers
- feature = 'outgoingPermission/autoTransferNumbers'
- async read(person_id: str, org_id: str | None = None) AutoTransferNumbers [source]
Retrieve Transfer Numbers Settings for a Workspace.
When calling a specific call type, this workspace will be automatically transferred to another number. The person assigned the Auto Transfer Number can then approve the call and send it through or reject the call type. You can add up to 3 numbers.
This API requires a full or read-only administrator auth token with a scope of spark-admin:workspaces_read or a user auth token with spark:workspaces_read scope can be used to read workspace settings.
- Parameters:
person_id (str) – Unique identifier for the workspace.
org_id (str) – Workspace 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:
auto transfer numbers
- Return type:
AutoTransferNumbers
- async configure(person_id: str, settings: AutoTransferNumbers, org_id: str | None = None)[source]
Modify Transfer Numbers Settings for a Place.
When calling a specific call type, this workspace will be automatically transferred to another number. The person assigned the Auto Transfer Number can then approve the call and send it through or reject the call type. You can add up to 3 numbers.
This API requires a full or user administrator auth token with the spark-admin:workspaces_write scope or a user auth token with spark:workspaces_write scope can be used to update workspace settings.
- Parameters:
person_id (str) – Unique identifier for the workspace.
settings (
AutoTransferNumbers
) – new auto transfer numbersorg_id (str) – Workspace 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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsTrunkApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for everything trunks
- list_gen(name: str | None = None, location_name: str | None = None, trunk_type: str | None = None, order: str | None = None, org_id: str | None = None, **params) AsyncGenerator[Trunk, None, None] [source]
List all Trunks for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow ebex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (str) – Return the list of trunks matching the local gateway names.
location_name (str) – Return the list of trunks matching the location names.
trunk_type (str) – Return the list of trunks matching the trunk type.
order (str) – Order the trunks according to the designated fields. Available sort fields: name, locationName. Sort order is ascending by default
org_id (str) –
- Returns:
generator of Trunk instances
- Return type:
Trunk
- async list(name: str | None = None, location_name: str | None = None, trunk_type: str | None = None, order: str | None = None, org_id: str | None = None, **params) List[Trunk] [source]
List all Trunks for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow ebex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
name (str) – Return the list of trunks matching the local gateway names.
location_name (str) – Return the list of trunks matching the location names.
trunk_type (str) – Return the list of trunks matching the trunk type.
order (str) – Order the trunks according to the designated fields. Available sort fields: name, locationName. Sort order is ascending by default
org_id (str) –
- Returns:
generator of Trunk instances
- Return type:
Trunk
- async create(name: str, location_id: str, password: str, trunk_type: TrunkType = TrunkType.registering, dual_identity_support_enabled: bool | None = None, device_type: TrunkDeviceType | None = None, address: str | None = None, domain: str | None = None, port: int | None = None, max_concurrent_calls: int | None = None, org_id: str | None = None) str [source]
Create a Trunk for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Creating a trunk requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
name (str) – A unique name for the trunk.
location_id (str) – ID of location associated with the trunk.
password (str) – A password to use on the trunk.
trunk_type (
TrunkType
) – Trunk Type associated with the trunk.dual_identity_support_enabled (bool) – Dual Identity Support setting impacts the handling of the From header and P-Asserted-Identity header when sending an initial SIP INVITE to the trunk for an outbound call.
device_type (
TrunkDeviceType
) – Device type associated with trunk.address (str) – FQDN or SRV address. Required to create a static certificate-based trunk.
domain (str) – Domain name. Required to create a static certificate based trunk.
port (int) – FQDN port. Required to create a static certificate-based trunk.
max_concurrent_calls (int) – Max Concurrent call. Required to create a static certificate based trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id of new trunk
- Return type:
str
- async details(trunk_id: str, org_id: str | None = None) TrunkDetail [source]
Get a Trunk for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving a trunk requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
trunk details
- Return type:
TrunkDetail
- async update(trunk_id: str, name: str, location_id: str, password: str, trunk_type: TrunkType, dual_identity_support_enabled: bool | None = None, max_concurrent_calls: int | None = None, org_id: str | None = None)[source]
Modify a Trunk for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Modifying a trunk requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
trunk_id –
location_id (str) – ID of location associated with the trunk.
password (str) – A password to use on the trunk.
trunk_type (
TrunkType
) – Trunk Type associated with the trunk.dual_identity_support_enabled (bool) – Dual Identity Support setting impacts the handling of the From header and P-Asserted-Identity header when sending an initial SIP INVITE to the trunk for an outbound call.
max_concurrent_calls (int) – Max Concurrent call. Required to create a static certificate based trunk.
org_id (str:return:) – Organization to which trunk belongs.
- async delete_trunk(trunk_id: str, org_id: str | None = None)[source]
Delete a Trunk for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Deleting a trunk requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- async trunk_types(org_id: str | None = None) List[TrunkTypeWithDeviceType] [source]
List all TrunkTypes with DeviceTypes for the organization.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy. Trunk Types are Registering or Certificate Based and are configured in CallManager.
Retrieving trunk types requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id –
- Returns:
trunk types
- Return type:
list[
TrunkTypeWithDeviceType
]
- async usage(trunk_id: str, org_id: str | None = None) TrunkUsage [source]
Get Local Gateway Usage Count
A trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
usage counts
- Return type:
TrunkUsage
- usage_dial_plan_gen(trunk_id: str, org_id: str | None = None) AsyncGenerator[IdAndName, None, None] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- async usage_dial_plan(trunk_id: str, org_id: str | None = None) List[IdAndName] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- usage_location_pstn_gen(trunk_id: str, org_id: str | None = None) AsyncGenerator[IdAndName, None, None] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- async usage_location_pstn(trunk_id: str, org_id: str | None = None) List[IdAndName] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- usage_route_group_gen(trunk_id: str, org_id: str | None = None) AsyncGenerator[IdAndName, None, None] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- async usage_route_group(trunk_id: str, org_id: str | None = None) List[IdAndName] [source]
Get Local Gateway Dial Plan Usage for a Trunk.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Retrieving this information requires a full administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
trunk_id (str) – ID of the trunk.
org_id (str) – Organization to which trunk belongs.
- Returns:
id and name objects
- async validate_fqdn_and_domain(address: str, domain: str, port: int | None = None, org_id: str | None = None)[source]
Validate Local Gateway FQDN and Domain for the organization trunks.
A Trunk is a connection between Webex Calling and the premises, which terminates on the premises with a local gateway or other supported device. The trunk can be assigned to a Route Group - a group of trunks that allow Webex Calling to distribute calls over multiple trunks or to provide redundancy.
Validating Local Gateway FQDN and Domain requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
address (str) – FQDN or SRV address of the trunk.
domain (str) – Domain name of the trunk.
port (int) – FQDN port of the trunk
org_id (str) – Organization to which trunk types belongs.
- base = 'telephony/config/premisePstn/trunks'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsVoiceMessagingApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Voice Messaging APIs provide support for handling voicemail and message waiting indicators in Webex Calling. The APIs are limited to user access (no admin access), and all GET commands require the spark:calls_read scope, while the other commands require the spark:calls_write scope.
- async summary() MessageSummary [source]
Get a summary of the voicemail messages for the user.
- list_gen(**params) AsyncGenerator[VoiceMessageDetails, None, None] [source]
Get the list of all voicemail messages for the user.
- async list(**params) List[VoiceMessageDetails] [source]
Get the list of all voicemail messages for the user.
- async delete(message_id: str)[source]
Delete a specfic voicemail message for the user.
- Parameters:
message_id (str) – The message identifer of the voicemail message to delete
- async mark_as_read(message_id: str)[source]
Update the voicemail message(s) as read for the user. If the messageId is provided, then only mark that message as read. Otherwise, all messages for the user are marked as read.
- Parameters:
message_id (str) – The voicemail message identifier of the message to mark as read. If the messageId is not provided, then all voicemail messages for the user are marked as read.
- async mark_as_unread(message_id: str)[source]
Update the voicemail message(s) as unread for the user. If the messageId is provided, then only mark that message as unread. Otherwise, all messages for the user are marked as unread.
- Parameters:
message_id (str) – The voicemail message identifier of the message to mark as unread. If the messageId is not provided, then all voicemail messages for the user are marked as unread.
- base = 'telephony/voiceMessages'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsVoicePortalApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
location voice portal API
- async read(location_id: str, org_id: str | None = None) VoicePortalSettings [source]
- Parameters:
location_id (str) – Location to which the voice portal belongs.
org_id (str) – Organization to which the voice portal belongs.
- Returns:
location voice portal settings
- Return type:
- async update(location_id: str, settings: VoicePortalSettings, passcode: str | None = None, org_id: str | None = None)[source]
Update VoicePortal
Update Voice portal information for the location.
Voice portals provide an interactive voice response (IVR) system so administrators can manage auto attendant announcements.
Updating voice portal information for organization and/or rules requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location to which the voice portal belongs.
settings (VoicePortalSettings) – new settings
passcode (str) – new passcode
org_id (str) – Organization to which the voice portal belongs.
- async passcode_rules(location_id: str, org_id: str | None = None) PasscodeRules [source]
Get VoicePortal Passcode Rule
Retrieve the voice portal passcode rule for a location.
Voice portals provide an interactive voice response (IVR) system so administrators can manage auto attendant announcements
Retrieving the voice portal passcode rule requires a full read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve voice portal passcode rules for this location.
org_id (str) – Retrieve voice portal passcode rules for this organization.
- Returns:
passcode rules
- Return type:
- base = 'telephony/config/locations'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsVoicemailApi(*, session: AsRestSession, workspaces: bool = False, locations: bool = False)[source]
Bases:
AsPersonSettingsApiChild
API for person’s call voicemail settings
- feature = 'voicemail'
- async read(person_id: str, org_id: str | None = None) VoicemailSettings [source]
Read Voicemail Settings for a Person Retrieve a Person’s Voicemail Settings
The voicemail feature transfers callers to voicemail based on your settings. You can then retrieve voice messages via Voicemail. Voicemail audio is sent in Waveform Audio File Format, .wav, format.
Optionally, notifications can be sent to a mobile phone via text or email. These notifications will not include the voicemail files.
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 person to read their settings.
- 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:
user’s voicemail settings
- Return type:
- async configure(person_id: str, settings: VoicemailSettings, org_id: str | None = None)[source]
Configure Voicemail Settings for a Person Configure a person’s Voicemail Settings
The voicemail feature transfers callers to voicemail based on your settings. You can then retrieve voice messages via Voicemail. Voicemail audio is sent in Waveform Audio File Format, .wav, format.
Optionally, notifications can be sent to a mobile phone via text or email. These notifications will not include the voicemail files.
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 person to update their settings. :return:
- configure_busy_greeting(person_id: str, content: BufferedReader | str, upload_as: str | None = None, org_id: str | None = None)[source]
Configure Busy Voicemail Greeting for a Person Configure a Person’s Busy Voicemail Greeting by uploading a Waveform Audio File Format, .wav, encoded audio file.
Your request will need to be a multipart/form-data request rather than JSON, using the audio/wav Content-Type.
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 person to update their settings.
- Parameters:
person_id (str) – Unique identifier for the person.
content (Union[BufferedReader, str]) – the file to be uploaded, can be a path to a file or a buffered reader (opened file); if a reader referring to an open file is passed then make sure to open the file as binary b/c otherwise the content length might be calculated wrong
upload_as (str) – filename for the content. Only required if content is a reader; has to be a .wav file name.
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.
- configure_no_answer_greeting(person_id: str, content: BufferedReader | str, upload_as: str | None = None, org_id: str | None = None)[source]
Configure No Answer Voicemail Greeting for a Person Configure a Person’s No Answer Voicemail Greeting by uploading a Waveform Audio File Format, .wav, encoded audio file.
Your request will need to be a multipart/form-data request rather than JSON, using the audio/wav Content-Type.
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 person to update their settings.
- Parameters:
person_id (str) – Unique identifier for the person.
content (Union[BufferedReader, str]) – the file to be uploaded, can be a path to a file or a buffered reader (opened file); if a reader referring to an open file is passed then make sure to open the file as binary b/c otherwise the content length might be calculated wrong
upload_as (str) – filename for the content. Only required if content is a reader; has to be a .wav file name.
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.
- base = ''
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsVoicemailGroupsApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for voicemail groups
- ep(location_id: str | None = None, path: str | None = None)[source]
- Parameters:
location_id –
path –
- Returns:
- list_gen(location_id: str | None = None, name: str | None = None, phone_number: str | None = None, org_id: str | None = None, **params) AsyncGenerator[VoicemailGroup, None, None] [source]
List the voicemail group information for the organization.
You can create a shared voicemail box and inbound fax box to assign to users or call routing features like an auto attendant, call queue, or hunt group.
Retrieving voicemail Group for the organization requires a full read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Location to which the voicemail group belongs.
name (str) – Search (Contains) based on voicemail group name
phone_number (str) – Search (Contains) based on number or extension
org_id (str) – Organization to which the voicemail group belongs.
- Returns:
yields ::class::VoicemailGroup instances
- async list(location_id: str | None = None, name: str | None = None, phone_number: str | None = None, org_id: str | None = None, **params) List[VoicemailGroup] [source]
List the voicemail group information for the organization.
You can create a shared voicemail box and inbound fax box to assign to users or call routing features like an auto attendant, call queue, or hunt group.
Retrieving voicemail Group for the organization requires a full read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Location to which the voicemail group belongs.
name (str) – Search (Contains) based on voicemail group name
phone_number (str) – Search (Contains) based on number or extension
org_id (str) – Organization to which the voicemail group belongs.
- Returns:
yields ::class::VoicemailGroup instances
- async details(location_id: str, voicemail_group_id: str, org_id: str | None = None) VoicemailGroupDetail [source]
Retrieve voicemail group details for a location.
Manage your voicemail group settings for a specific location, like when you want your voicemail to be active, message storage settings, and how you would like to be notified of new voicemail messages.
Retrieving voicemail group details requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
location_id (str) – Retrieve voicemail group details for this location.
voicemail_group_id (str) – Retrieve voicemail group details for this voicemail group ID.
org_id (str) – Retrieve voicemail group details for a customer location.
- Returns:
Voicemail group settings
- Type:
VoicemailGroupDetail
- async update(location_id: str, voicemail_group_id: str, settings: VoicemailGroupDetail, org_id: str | None = None)[source]
Modifies the voicemail group location details for a particular location for a customer.
Manage your voicemail settings, like when you want your voicemail to be active, message storage settings, and how you would like to be notified of new voicemail messages.
Modifying the voicemail group location details requires a full, user administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Modifies the voicemail group details for this location.
voicemail_group_id (str) – Modifies the voicemail group details for this voicemail group ID.
settings (
VoicemailGroupDetail
) – New settingsorg_id (str) – Modifies the voicemail group details for a customer location.
- async create(location_id: str, settings: VoicemailGroupDetail, org_id: str | None = None) str [source]
Create new voicemail group for the given location for a customer.
Voicemail group can be created for given location for a customer.
Creating voicemail group for the given location requires a full or user administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Create new voice mail group for this location.
settings (
VoicemailGroupDetail
) –settings for new voicemail group Example:
settings = VoicemailGroupDetail.create( name=vmg_name, extension=extension, first_name='first', last_name='last', passcode=740384) vmg_id = api.telephony.voicemail_groups.create(location_id=location_id, settings=settings)
org_id (str) – Create new voice mail group for this organization.
- Returns:
UUID of the newly created voice mail group.
- Return type:
str
- async delete(location_id: str, voicemail_group_id: str, org_id: str | None = None)[source]
Delete the designated voicemail group.
Deleting a voicemail group requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location from which to delete a voicemail group.
voicemail_group_id (str) – Delete the voicemail group with the matching ID.
org_id (str) – Delete the voicemail group from this organization.
- base = 'telephony/config/voicemailGroups'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsVoicemailRulesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for voicemail rules settings
- async read(org_id: str | None = None) VoiceMailRules [source]
Get Voicemail Rules
Retrieve the organization’s voicemail rules.
Organizational voicemail rules specify the default passcode requirements.
Retrieving the organization’s voicemail rules requires a full, user or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve voicemail settings for this organization.
- Returns:
VM settings
- Return type:
- async update(settings: VoiceMailRules, org_id: str | None = None)[source]
Update Voicemail Rules
Update the organization’s default voicemail passcode and/or rules.
Organizational voicemail rules specify the default passcode requirements.
If you choose to set default passcode for new people added to your organization, communicate to your people what that passcode is, and that it must be reset before they can access their voicemail. If this feature is not turned on, each new person must initially set their own passcode.
Updating organization’s voicemail passcode and/or rules requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
settings (VoiceMailRules) – new settings
org_id (str) – Update voicemail rules for this organization.
- base = 'telephony/config/voicemail/rules'
- session: AsRestSession
REST session
- class wxc_sdk.as_api.AsWebexSimpleApi(*, tokens: str | Tokens | None = None, concurrent_requests: int = 10)[source]
Bases:
object
The main API object
- Parameters:
tokens – token to be used by the API. Can be a
tokens.Tokens
instance, a string or None. If None then an access token is expected in the WEBEX_ACCESS_TOKEN environment variable.concurrent_requests (int) – number of concurrent requests when using multi-threading
- attachment_actions: AsAttachmentActionsApi
Attachment actions API
AsAttachmentActionsApi
- cdr: AsDetailedCDRApi
CDR API
AsDetailedCDRApi
- devices: AsDevicesApi
devices API
AsDevicesApi
- events: AsEventsApi
events API;
AsEventsApi
- groups: AsGroupsApi
groups API
AsGroupsApi
- licenses: AsLicensesApi
Licenses API
AsLicensesApi
- locations: AsLocationsApi
Location API
AsLocationsApi
- membership: AsMembershipApi
membership API
AsMembershipApi
- messages: AsMessagesApi
Messages API
AsMessagesApi
- organizations: AsOrganizationApi
organization settings API
- person_settings: AsPersonSettingsApi
Person settings API
AsPersonSettingsApi
- people: AsPeopleApi
People API
AsPeopleApi
- reports: AsReportsApi
Reports API
AsReportsApi
- rooms: AsRoomsApi
Rooms API
AsRoomsApi
- room_tabs: AsRoomTabsApi
Room tabs API
AsRoomTabsApi
- teams: AsTeamsApi
Teams API
AsTeamsApi
- team_memberships: AsTeamMembershipsApi
Team memberships API
AsTeamMembershipsApi
- telephony: AsTelephonyApi
Telephony (features) API
AsTelephonyApi
- webhook: AsWebhookApi
Webhooks API
AsWebhookApi
- workspaces: AsWorkspacesApi
Workspaces API
AsWorkspacesApi
- workspace_locations: AsWorkspaceLocationApi
Workspace locations API;
AsWorkspaceLocationApi
- workspace_settings: AsWorkspaceSettingsApi
Workspace setting API
AsWorkspaceSettingsApi
- session: AsRestSession
AsRestSession
used for all API requests
- property access_token: str
access token used for all requests
- Returns:
access token
- Return type:
str
- class wxc_sdk.as_api.AsWebhookApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
API for webhook management
- base = 'webhooks'
- session: AsRestSession
REST session
- list_gen() AsyncGenerator[Webhook, None, None] [source]
List all of your webhooks.
- Returns:
yields webhooks
- async create(name: str, target_url: str, resource: WebhookResource, event: WebhookEventType, filter: str | None = None, secret: str | None = None, owned_by: str | None = None) Webhook [source]
Creates a webhook.
- Parameters:
name – A user-friendly name for the webhook.
target_url – The URL that receives POST requests for each event.
resource – The resource type for the webhook. Creating a webhook requires ‘read’ scope on the resource the webhook is for.
event – The event type for the webhook.
filter – The filter that defines the webhook scope.
secret – The secret used to generate payload signature.
owned_by – Specified when creating an org/admin level webhook. Supported for meetings, recordings and meetingParticipants resources for now.
- Returns:
the new webhook
- async details(webhook_id: str) Webhook [source]
Get Webhook Details Shows details for a webhook, by ID.
- Parameters:
webhook_id (str) – The unique identifier for the webhook.
- Returns:
Webhook details
- async update(webhook_id: str, update: Webhook) Webhook [source]
Updates a webhook, by ID. You cannot use this call to deactivate a webhook, only to activate a webhook that was auto deactivated. The fields that can be updated are name, targetURL, secret and status. All other fields, if supplied, are ignored.
- Parameters:
webhook_id (str) – The unique identifier for the webhook.
update (Webhook) – The webhook update
- Returns:
updated
Webhook
object
- class wxc_sdk.as_api.AsWorkspaceLocationApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- base = 'workspaceLocations'
- floors: AsWorkspaceLocationFloorApi
Workspace location floor API
AsWorkspaceLocationFloorApi
- ep(location_id: str | None = None)[source]
endpoint URL for given path
- Parameters:
path (str) – path after APIChild subclass specific endpoint URI prefix
- Returns:
endpoint URL
- Return type:
str
- list_gen(display_name: str | None = None, address: str | None = None, country_code: str | None = None, city_name: str | None = None, org_id: str | None = None, **params) AsyncGenerator[WorkspaceLocation, None, None] [source]
List workspace locations
- Parameters:
display_name (str) – Location display name.
address (str) – Location address
country_code (str) – Location country code (ISO 3166-1).
city_name (str) – Location city name.
org_id (str) – Organization id
params – addtl. parameters
- Returns:
generator of
WorkspaceLocation
instances
- async list(display_name: str | None = None, address: str | None = None, country_code: str | None = None, city_name: str | None = None, org_id: str | None = None, **params) List[WorkspaceLocation] [source]
List workspace locations
- Parameters:
display_name (str) – Location display name.
address (str) – Location address
country_code (str) – Location country code (ISO 3166-1).
city_name (str) – Location city name.
org_id (str) – Organization id
params – addtl. parameters
- Returns:
generator of
WorkspaceLocation
instances
- async create(display_name: str, address: str, country_code: str, latitude: float, longitude: float, city_name: str | None = None, notes: str | None = None, org_id: str | None = None) WorkspaceLocation [source]
Create a location. The cityName and notes parameters are optional, and omitting them will result in the creation of a location without these values set.
- Parameters:
display_name – A friendly name for the location.
address – The location address.
country_code – The location country code (ISO 3166-1).
latitude – The location latitude.
longitude – The location longitude.
city_name – The location city name.
notes – Notes associated to the location.
org_id –
- Returns:
created workspace location
- Return type:
- async details(location_id: str, org_id: str | None = None) WorkspaceLocation [source]
Get a Workspace Location Details Shows details for a location, by ID. Specify the location ID in the locationId parameter in the URI.
- Parameters:
location_id (str) – A unique identifier for the location.
org_id (str) –
- Returns:
Workspace location details
- Return type:
- async update(location_id: str, settings: WorkspaceLocation, org_id: str | None = None)[source]
Update a Workspace Location Updates details for a location, by ID. Specify the location ID in the locationId parameter in the URI. Include all details for the location that are present in a Get Workspace Location Details. Not including the optional cityName or notes fields (setting them to None) will result in the fields no longer being defined for the location.
- Parameters:
location_id (str) – A unique identifier for the location.
settings (WorkspaceLocation) – new settings
org_id (str) –
- Returns:
updated workspace location
- Return type:
- class wxc_sdk.as_api.AsWorkspaceLocationFloorApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- base = 'workspaceLocations'
- session: AsRestSession
REST session
- ep(location_id: str, floor_id: str | None = None)[source]
endpoint URL for given path
- Parameters:
path (str) – path after APIChild subclass specific endpoint URI prefix
- Returns:
endpoint URL
- Return type:
str
- list_gen(location_id: str, org_id: str | None = None) AsyncGenerator[WorkspaceLocationFloor, None, None] [source]
- Parameters:
location_id –
org_id –
- Returns:
- async list(location_id: str, org_id: str | None = None) List[WorkspaceLocationFloor] [source]
- Parameters:
location_id –
org_id –
- Returns:
- async create(location_id: str, floor_number: int, display_name: str | None = None, org_id: str | None = None) WorkspaceLocationFloor [source]
Create a Workspace Location Floor
Create a new floor in the given location. The displayName parameter is optional, and omitting it will result in the creation of a floor without that value set.
- Parameters:
location_id (str) – A unique identifier for the location.
floor_number –
display_name –
org_id (str) –
- Returns:
new workspace location floor
- Return type:
- async details(location_id: str, floor_id: str, org_id: str | None = None) WorkspaceLocationFloor [source]
Get a Workspace Location Floor Details
Shows details for a floor, by ID. Specify the floor ID in the floorId parameter in the URI.
- Parameters:
location_id (str) – A unique identifier for the location.
floor_id (str) – A unique identifier for the floor.
org_id (str) –
- Returns:
workspace location floor details
- Return type:
- async update(location_id: str, floor_id: str, settings: WorkspaceLocationFloor, org_id: str | None = None) WorkspaceLocationFloor [source]
Updates details for a floor, by ID. Specify the floor ID in the floorId parameter in the URI. Include all details for the floor that are present in a Get Workspace Location Floor Details. Not including the optional displayName field will result in the field no longer being defined for the floor.
- Parameters:
location_id (str) – A unique identifier for the location.
floor_id (str) – A unique identifier for the floor.
settings (WorkspaceLocationFloor) – new settings
org_id (str) –
- Returns:
updated workspace location floor
- class wxc_sdk.as_api.AsWorkspaceNumbersApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
- base = 'workspaces'
- session: AsRestSession
REST session
- async read(workspace_id: str, org_id: str | None = None) WorkSpaceNumbers [source]
List the PSTN phone numbers associated with a specific workspace, by ID, within the organization. Also shows the location and Organization associated with the workspace.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:workspaces_read.
- Parameters:
workspace_id (str) – List numbers for this workspace.
org_id (str) – List numbers for a workspace within this organization.
- Returns:
Workspace numbers
- Return type:
- class wxc_sdk.as_api.AsWorkspaceSettingsApi(session: AsRestSession)[source]
Bases:
AsApiChild
API for all workspace settings.
Most of the workspace settings are equivalent to corresponding user settings. For these settings the attributes of this class are instances of the respective user settings APIs. When calling endpoints of these APIs workspace IDs need to be passed to the
person_id
parameter of the called function.- base = 'workspaces'
- call_intercept: AsCallInterceptApi
- call_waiting: AsCallWaitingApi
- caller_id: AsCallerIdApi
- forwarding: AsPersonForwardingApi
- monitoring: AsMonitoringApi
- numbers: AsWorkspaceNumbersApi
- permissions_in: AsIncomingPermissionsApi
- permissions_out: AsOutgoingPermissionsApi
- class wxc_sdk.as_api.AsWorkspacesApi(*, session: AsRestSession, base: str | None = None)[source]
Bases:
AsApiChild
Workspaces API
Workspaces represent where people work, such as conference rooms, meeting spaces, lobbies, and lunch rooms. Devices may be associated with workspaces.
Viewing the list of workspaces in an organization requires an administrator auth token with the spark-admin:workspaces_read scope. Adding, updating, or deleting workspaces in an organization requires an administrator auth token with the spark-admin:workspaces_write scope.
The Workspaces API can also be used by partner administrators acting as administrators of a different organization than their own. In those cases an orgId value must be supplied, as indicated in the reference documentation for the relevant endpoints.
- base = 'workspaces'
- session: AsRestSession
REST session
- list_gen(workspace_location_id: str | None = None, floor_id: str | None = None, display_name: str | None = None, capacity: int | None = None, workspace_type: WorkSpaceType | None = None, calling: CallingType | None = None, calendar: CalendarType | None = None, org_id: str | None = None, **params) AsyncGenerator[Workspace, None, None] [source]
List Workspaces
List workspaces. Use query parameters to filter the response. The orgId parameter can only be used by admin users of another organization (such as partners). The workspaceLocationId, floorId, capacity and type fields will only be present for workspaces that have a value set for them. The special values notSet (for filtering on category) and -1 (for filtering on capacity) can be used to filter for workspaces without a type and/or capacity.
- Parameters:
workspace_location_id (str) – Location associated with the workspace
floor_id (str) – Floor associated with the workspace.
display_name (str) – List workspaces by display name.
capacity (int) – List workspaces with the given capacity. Must be -1 or higher. A value of -1 lists workspaces with no capacity set.
workspace_type (
WorkSpaceType
) – List workspaces by type.calling (
CallingType
) – List workspaces by calling type.calendar (
CalendarType
) – List workspaces by calendar type.org_id (str) – List workspaces in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
generator of
Workspace
instances
- async list(workspace_location_id: str | None = None, floor_id: str | None = None, display_name: str | None = None, capacity: int | None = None, workspace_type: WorkSpaceType | None = None, calling: CallingType | None = None, calendar: CalendarType | None = None, org_id: str | None = None, **params) List[Workspace] [source]
List Workspaces
List workspaces. Use query parameters to filter the response. The orgId parameter can only be used by admin users of another organization (such as partners). The workspaceLocationId, floorId, capacity and type fields will only be present for workspaces that have a value set for them. The special values notSet (for filtering on category) and -1 (for filtering on capacity) can be used to filter for workspaces without a type and/or capacity.
- Parameters:
workspace_location_id (str) – Location associated with the workspace
floor_id (str) – Floor associated with the workspace.
display_name (str) – List workspaces by display name.
capacity (int) – List workspaces with the given capacity. Must be -1 or higher. A value of -1 lists workspaces with no capacity set.
workspace_type (
WorkSpaceType
) – List workspaces by type.calling (
CallingType
) – List workspaces by calling type.calendar (
CalendarType
) – List workspaces by calendar type.org_id (str) – List workspaces in this organization. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
generator of
Workspace
instances
- async create(settings: Workspace, org_id: str | None = None)[source]
Create a Workspace
Create a workspace. The workspaceLocationId, floorId, capacity, type and notes parameters are optional, and omitting them will result in the creation of a workspace without these values set, or set to their default. A workspaceLocationId must be provided when the floorId is set. Calendar and calling can also be set for a new workspace. Omitting them will default to free calling and no calendaring. The orgId parameter can only be used by admin users of another organization (such as partners).
- Parameters:
settings (
Workspace
) – settings for new Workspaceorg_id (str) – OrgId associated with the workspace. Only admin users of another organization (such as partners) may use this parameter.
- Returns:
new workspace
- Return type:
Workspace
- async details(workspace_id) Workspace [source]
Get Workspace Details
Shows details for a workspace, by ID. The workspaceLocationId, floorId, capacity, type and notes fields will only be present if they have been set for the workspace.
- Parameters:
workspace_id (str) – A unique identifier for the workspace.
- Returns:
workspace details
- Return type:
Workspace
- async update(workspace_id, settings: Workspace) Workspace [source]
Update a Workspace
Updates details for a workspace, by ID. Specify the workspace ID in the workspaceId parameter in the URI. Include all details for the workspace that are present in a GET request for the workspace details. Not including the optional capacity, type or notes fields will result in the fields no longer being defined for the workspace. A workspaceLocationId must be provided when the floorId is set. The workspaceLocationId, floorId, calendar and calling fields do not change when omitted from the update request. Updating the calling parameter is not supported.
- Parameters:
workspace_id (str) – A unique identifier for the workspace.
settings (
Workspace
) – new workspace settings
- Returns:
updated workspace
- Return type:
Workspace