This Python script allows you to interact with the Webex Contact Center API to:
- Fetch URLs for task captures.
- Optionally download the capture files (also called voice recordings) directly, renaming them for better organization.
- Fetch capture URLs for up to 10 task IDs in a single request using list captures API call
- Parse and save capture URLs into a text file for use with tools like
wget
. - Download captures directly, renaming them as
<taskId>_<fileName>.wav
. - Supports YAML configuration for API keys and settings.
- Developer mode for detailed debugging logs.
- Python 3.7+
- Required Python libraries:
requests
pyyaml
Install dependencies using:
pip install requests pyyaml
Prepare a text file (e.g., input.txt
) with up to 10 task IDs, each on a new line, you can use Analyser to fetch the session IDs from the voice calls you need to download the recordings from:
task-id-1
task-id-2
...
Create a config.yml
file with the following format:
# Configuration for Webex Contact Center API
org-id: "<your-org-id>"
base-url: "<webex-api-base-url>"
api-key: "<your-api-key>"
Replace the placeholders with your actual values.
Run the script with:
python script.py <input_file> <output_file> [options]
<input_file>
: Path to the input file containing task IDs.<output_file>
: Path to save the list of capture URLs.
-c
--config
: Path to the YAML configuration file (default:config.yml
).-i
--include-segments
: Include segmented captures in the results.-u
--url-expiration
: URL expiration time in minutes (default: 10).-d
--download
: Download the capture files directly.-o
--output-directory
: Directory to save downloaded files (default:downloads
).-d
--developer-mode
: Enable detailed logging for debugging.
python script.py input.txt output.txt
python script.py input.txt output.txt --download
python script.py input.txt output.txt --developer-mode
- URL Mode: A text file containing capture URLs, one per line.
- Download Mode: Files saved to the specified directory, renamed as
<taskId>_<fileName>.wav
.
- The script enforces a limit of 10 task IDs. Exceeding this limit will raise an error.
- Missing or invalid configuration parameters in
config.yml
will cause the script to exit with an error message.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Feel free to fork this repository and submit pull requests.