Skip to content

Feature/add support for webex contact center#23

Merged
lingy1028 merged 20 commits into
mainfrom
feature/add-support-for-webex-contact-center
Apr 3, 2026
Merged

Feature/add support for webex contact center#23
lingy1028 merged 20 commits into
mainfrom
feature/add-support-for-webex-contact-center

Conversation

@lingy1028

Copy link
Copy Markdown
Collaborator
  • Added support for POST method in the Generic Input
  • Added support for search endpoint of Webex Contact Center

@lingy1028
lingy1028 removed the request for review from edro15 February 27, 2026 19:41
Comment thread package/bin/webex_api_client.py Outdated
Comment thread package/bin/input_module_webex_generic_endpoint.py Outdated

@edro15 edro15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lingy1028 it looks good overall! Added some comments.

Comment thread package/bin/webex_constants.py Outdated
_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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_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?

Comment thread package/bin/webex_api_client.py Outdated
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':

@edro15 edro15 Mar 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread package/bin/webex_constants.py Outdated
Comment on lines +18 to +19
_Webex_Contact_Center_BASE_URL_PREFIX = "api.wxcc"
_Webex_Contact_Center_BASE_URL = "api.wxcc-{region}.cisco.com"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_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"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. _WEBEX_CONTACTCENTER_BASE_URL_PREFIX will not be used any more. Will remove it.

Comment thread package/bin/webex_api_client.py Outdated
Comment on lines +114 to +125
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines +11 to +23
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these 2 functions are used in other inputs, please place them in a common utils.py (for example) and import them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I think only to_epoch_ms could be used for other inputs in the future. Will place it in utils.py

@lingy1028
lingy1028 merged commit 488dbff into main Apr 3, 2026
5 checks passed
@lingy1028
lingy1028 deleted the feature/add-support-for-webex-contact-center branch April 3, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants