From 31d69d75e98018362457a83ea52b7b4ada8b66d0 Mon Sep 17 00:00:00 2001 From: Joshua Teitelbaum Date: Wed, 16 Oct 2024 08:37:35 -0700 Subject: [PATCH] Fixes issue #658 deprecate zopim domain on Chat APIs --- zenpy/lib/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zenpy/lib/api.py b/zenpy/lib/api.py index 0de75f1..b327d52 100644 --- a/zenpy/lib/api.py +++ b/zenpy/lib/api.py @@ -403,7 +403,8 @@ def _check_response(self, response): def _build_url(self, endpoint, api_prefix=None): """ Build complete URL """ - if not issubclass(type(self), ChatApiBase) and not self.subdomain: + # Oct 29, 2024 we will require subdomain to be defined and NOT allow Zopim only requests. + if not self.subdomain: raise ZenpyException( "subdomain is required when accessing the Zendesk API!") @@ -2116,8 +2117,7 @@ def __init__(self, config, endpoint, request_handler=None): super(ChatApiBase, self).__init__(config, object_type='chat', endpoint=endpoint) - self.domain = 'www.zopim.com' - self.subdomain = '' + self.api_prefix = "api/v2/chat" self._request_handler = request_handler or ChatApiRequest self._object_mapping = ChatObjectMapping(self) self._response_handlers = (DeleteResponseHandler,