wxc_sdk.telephony.announcements_repo package

Not supported for Webex for Government (FedRAMP) Features: Announcement Repository support reading and writing of Webex Calling Announcement Repository settings for a specific organization.

class wxc_sdk.telephony.announcements_repo.RepoAnnouncement(*, id: str, name: str, fileName: str | None = None, fileSize: int | None = None, mediaFileType: MediaFileType | None = None, lastUpdated: datetime | None = None, level: AnnouncementLevel | None = None, location: IdAndName | None = None, featureReferenceCount: int | None = None, featureReferences: list[FeatureReference] | None = None)[source]

Bases: IdAndName

file_name: str | None

File name of the uploaded binary announcement greeting.

file_size: int | None

Size of the file in kilobytes.

media_file_type: MediaFileType | None

Media file type of the announcement file.

last_updated: datetime | None

LastUpdated timestamp (in UTC format) of the announcement.

level: AnnouncementLevel | None

The level at which this announcement exists.

location: IdAndName | None

The details of location at which this announcement exists.

feature_reference_count: int | None

The below is not returned by list(), only by details() Reference count of the call features this announcement is assigned to.

feature_references: list[FeatureReference] | None

Call features referenced by this announcement.

class wxc_sdk.telephony.announcements_repo.AnnouncementsRepositoryApi(*, session: RestSession, base: str | None = None)[source]

Bases: ApiChild

Not supported for Webex for Government (FedRAMP)

Features: Announcement Repository support reading and writing of Webex Calling Announcement Repository settings for a specific organization.

Viewing these read-only organization settings requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read. Modifying these organization settings requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

A partner administrator can retrieve or change settings in a customer’s organization using the optional orgId query parameter.

list(location_id: str | None = None, order: str | None = None, file_name: str | None = None, file_type: str | None = None, media_file_type: str | None = None, name: str | None = None, org_id: str | None = None, **params) Generator[RepoAnnouncement, None, None][source]

Fetch a list of binary announcement greetings at an organization as well as location level. An admin can upload a file at an organization level. This file will be uploaded to the announcement repository. This API 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 enterprise or Location announcement files. Without this parameter, the Enterprise level announcements are returned. Possible values: all, locations, Y2lzY29zcGFyazovL3VzL0xPQ0FUSU9OLzMxMTYx

  • order (str) – Sort the list according to fileName or fileSize. The default sort will be in Ascending order.

  • file_name (str) – Return the list of announcements with the given fileName.

  • file_type (str) – Return the list of announcement files for this fileType.

  • media_file_type (str) – Return the list of announcement files for this mediaFileType.

  • name (str) – Return the list of announcement files for this announcement label.

  • org_id (str) – Create an announcement in this organization.

Returns:

yields RepoAnnouncement objects

upload_announcement(name: str, file: BufferedReader | str, upload_as: str | None = None, location_id: str | None = None, org_id: str | None = None) str[source]

Upload a binary file to the announcement repository at organization or location level. An admin can upload a file at an organization or location level. This file will be uploaded to the announcement repository. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write .

Parameters:
  • name (str) – Announcement name

  • file (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.

  • location_id (str) – Unique identifier of a location where an announcement is being created.

  • org_id (str) – Create an announcement in this organization.

Returns:

id of announcement

Return type:

str

Examples

# upload a local file as announcement at the org level
r = api.telephony.announcements_repo.upload_announcement(name='Sample', file='sample.wav')

# upload an announcement from an open file
# any files-like object can be used as input.
# note: the upload_as parameter is required to set the file name for the upload
with open('sample.wav', mode='rb') as wav_file:
    r = api.telephony.announcements_repo.upload_announcement(name='Sample', file=wav_file,
                                                             upload_as='sample.wav')

# upload an announcement from content in a string
with open('sample.wav', mode='rb') as wav_file:
    data = wav_file.read()

# data now is a bytes object with the file content. As we can use files-like objects as input
# it's also possible to use a BytesIO as input for upload_announcement()
binary_file = io.BytesIO(data)
r = self.api.telephony.announcements_repo.upload_announcement(name='Sample', file=binary_file,
                                                              upload_as='from_string.wav')
usage(location_id: str | None = None, org_id: str | None = None) RepositoryUsage[source]

Retrieves repository usage for announcements for an organization. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • location_id (str) – Unique identifier of a location

  • org_id (str) – Create an announcement in this organization.

details(announcement_id: str, location_id: str | None = None, org_id: str | None = None) RepoAnnouncement[source]

Fetch details of a binary announcement greeting by its ID at an organization level. An admin can upload a file at an organization level. This file will be uploaded to the announcement repository. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • location_id (str) – Unique identifier of a location

  • announcement_id (str) – Unique identifier of an announcement.

  • org_id (str) – Get details of an announcement in this organization.

delete(announcement_id: str, location_id: str | None = None, org_id: str | None = None)[source]

Delete an announcement greeting. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • announcement_id (str) – Unique identifier of an announcement.

  • location_id (str) – Unique identifier of a location where announcement is being deleted.

  • org_id (str) – Delete an announcement in this organization.

modify(announcement_id: str, name: str, file: BufferedReader | str, upload_as: str | None = None, location_id: str | None = None, org_id: str | None = None)[source]

Modify an existing announcement greeting This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • announcement_id (str) – Unique identifier of an announcement.

  • name (str) – Announcement name

  • file (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.

  • location_id (str) – Unique identifier of a location where announcement is being deleted.

  • org_id (str) – Modify an announcement in this organization.

base = 'telephony/config'
class wxc_sdk.telephony.announcements_repo.RepositoryUsage(*, totalFileSizeUsedKB: int | None = None, maxAudioFileSizeAllowedKB: int | None = None, maxVideoFileSizeAllowedKB: int | None = None, totalFileSizeLimitMB: int | None = None)[source]

Bases: ApiModel

total_file_size_used_kb: int | None

Total file size used by announcements in this repository in kilobytes.

max_audio_file_size_allowed_kb: int | None

Maximum audio file size allowed to upload in kilobytes.

max_video_file_size_allowed_kb: int | None

Maximum video file size allowed to upload in kilobytes.

total_file_size_limit_mb: int | None

Total file size limit for the repository in megabytes.

class wxc_sdk.telephony.announcements_repo.FeatureReference(*, id: str | None = None, name: str | None = None, type: str | None = None, locationId: str | None = None, locationName: str | None = None)[source]

Bases: ApiModel

id: str | None

Unique identifier of the call feature referenced. The call Feature can be Auto Attendant, Call Queue or Music On hold.

name: str | None

Name of the call feature referenced.

type: str | None

Resource Type of the call feature.

location_id: str | None

Unique identifier of the location.

location_name: str | None

Location name of the announcement file.