Feature/add support for webex contact center#23
Conversation
lingy1028
commented
Feb 24, 2026
- Added support for POST method in the Generic Input
- Added support for search endpoint of Webex Contact Center
edro15
left a comment
There was a problem hiding this comment.
Hey @lingy1028 it looks good overall! Added some comments.
| _GET_DETAILED_CALL_HISTORY = "cdr_feed" | ||
| _SECURITY_AUDIT_EVENTS_ENDPOINT = "admin/securityAudit/events" | ||
| _FEDRAMP_BASE_URL = "api-usgov.webex.com" | ||
| _Webex_Contact_Center_BASE_URL = "api.wxcc-us1.cisco.com" |
There was a problem hiding this comment.
| _Webex_Contact_Center_BASE_URL = "api.wxcc-us1.cisco.com" | |
| _WEBEX_CONTACTCENTER_BASE_URL = "api.wxcc-us1.cisco.com" |
Just to keep style consistency: capital letters for constants.
Since the base URL contains wxcc-us1, does it imply dependency on a specific region? Is there any wxcc-eu1 or wxcc-us2?
| url = f"{protocol}//analytics.{rest}" | ||
|
|
||
| # reconstruct the url for Webex Contact Center: search endpoints | ||
| if base_endpoint == _Webex_Contact_Center_BASE_URL and endpoint == 'search': |
There was a problem hiding this comment.
What if 1st condition is met, but 2nd condition is not? Values come from text fields, so a user may have typed a different endpoint than search.
Either you prevent that from the UI or you add here an else statement? I think at the moment it would proceed with the request using a different base URL?
…nto feature/add-support-for-webex-contact-center
| _Webex_Contact_Center_BASE_URL_PREFIX = "api.wxcc" | ||
| _Webex_Contact_Center_BASE_URL = "api.wxcc-{region}.cisco.com" |
There was a problem hiding this comment.
| _Webex_Contact_Center_BASE_URL_PREFIX = "api.wxcc" | |
| _Webex_Contact_Center_BASE_URL = "api.wxcc-{region}.cisco.com" | |
| _WEBEX_CONTACTCENTER_BASE_URL_PREFIX = "api.wxcc" | |
| _WEBEX_CONTACTCENTER_BASE_URL = _WEBEX_CONTACTCENTER_BASE_URL_PREFIX + "-{region}.cisco.com" |
There was a problem hiding this comment.
Sorry. _WEBEX_CONTACTCENTER_BASE_URL_PREFIX will not be used any more. Will remove it.
| if not is_custom_endpoint and endpoint == "meeting/qualities": | ||
| url = f"{protocol}//analytics.{rest}" | ||
| elif not is_custom_endpoint and endpoint == "cdr_feed": | ||
| #construct the URL depending on the region | ||
| if webex_account_region == "us_ca": | ||
| url = f"{protocol}//analytics-calling.{rest}" | ||
| else: | ||
| url = f"{protocol}//analytics-calling-{webex_account_region}.{rest}" | ||
|
|
||
| # reconstruct the url for Webex Contact Center: search endpoints | ||
| if base_endpoint.startswith(_Webex_Contact_Center_BASE_URL_PREFIX) and endpoint == 'search': | ||
| url = f"https://{base_endpoint}/search" |
There was a problem hiding this comment.
| if not is_custom_endpoint and endpoint == "meeting/qualities": | |
| url = f"{protocol}//analytics.{rest}" | |
| elif not is_custom_endpoint and endpoint == "cdr_feed": | |
| #construct the URL depending on the region | |
| if webex_account_region == "us_ca": | |
| url = f"{protocol}//analytics-calling.{rest}" | |
| else: | |
| url = f"{protocol}//analytics-calling-{webex_account_region}.{rest}" | |
| # reconstruct the url for Webex Contact Center: search endpoints | |
| if base_endpoint.startswith(_Webex_Contact_Center_BASE_URL_PREFIX) and endpoint == 'search': | |
| url = f"https://{base_endpoint}/search" | |
| if not is_custom_endpoint: | |
| if endpoint == "meeting/qualities": | |
| url = f"{protocol}//analytics.{rest}" | |
| if endpoint == "cdr_feed": | |
| #construct the URL depending on the region. Default is us_ca. | |
| url = f"{protocol}//analytics-calling.{rest}" | |
| if webex_account_region != "us_ca": | |
| url = url.replace("analytics-calling", f"analytics-calling-{webex_account_region}") | |
| if base_endpoint.startswith(_WEBEX_CONTACTCENTER_BASE_URL_PREFIX) and endpoint == 'search': | |
| url = f"https://{base_endpoint}/search" |
Simplified the ifs.
| def to_epoch_ms(iso_str): | ||
| """ | ||
| Converts date string, e.g. 2026-01-01T00:00:00Z to epoch time in milliseconds. | ||
| Handles the 'Z' suffix by treating it as UTC (+00:00). | ||
| """ | ||
| dt = datetime.fromisoformat(iso_str.replace('Z', '+00:00')) | ||
| return int(dt.timestamp() * 1000) | ||
|
|
||
| def extract_nested_list(response): | ||
| data_content = response.get("data", {}) | ||
| first_level_val = next(iter(data_content.values()), {}) | ||
| events = next(iter(first_level_val.values()), []) | ||
| return events |
There was a problem hiding this comment.
If these 2 functions are used in other inputs, please place them in a common utils.py (for example) and import them.
There was a problem hiding this comment.
Good idea. I think only to_epoch_ms could be used for other inputs in the future. Will place it in utils.py
…placed the text input with dropdown