fix: Update JunctionData URL construction to use API Gateway instead of direct EspoCRM endpoint
This commit is contained in:
@@ -633,9 +633,10 @@ class EspoCRMAPI:
|
||||
for doc in docs:
|
||||
print(f"{doc['documentName']}: {doc['syncstatus']}")
|
||||
"""
|
||||
# JunctionData endpoint is at root level, not under /api/v1
|
||||
base_url = self.api_base_url.rstrip('/').replace('/api/v1', '')
|
||||
url = f"{base_url}/JunctionData/CAIKnowledge/{knowledge_id}/dokumentes"
|
||||
# JunctionData uses API Gateway URL, not direct EspoCRM
|
||||
# Use gateway URL from env or construct from ESPOCRM_API_BASE_URL
|
||||
gateway_url = os.getenv('ESPOCRM_GATEWAY_URL', 'https://api.bitbylaw.com/vmh/crm')
|
||||
url = f"{gateway_url}/JunctionData/CAIKnowledge/{knowledge_id}/dokumentes"
|
||||
|
||||
self._log(f"GET {url}")
|
||||
|
||||
@@ -698,9 +699,9 @@ class EspoCRMAPI:
|
||||
update_last_sync=True
|
||||
)
|
||||
"""
|
||||
# JunctionData endpoint is at root level, not under /api/v1
|
||||
base_url = self.api_base_url.rstrip('/').replace('/api/v1', '')
|
||||
url = f"{base_url}/JunctionData/CAIKnowledge/{knowledge_id}/dokumentes/{document_id}"
|
||||
# JunctionData uses API Gateway URL, not direct EspoCRM
|
||||
gateway_url = os.getenv('ESPOCRM_GATEWAY_URL', 'https://api.bitbylaw.com/vmh/crm')
|
||||
url = f"{gateway_url}/JunctionData/CAIKnowledge/{knowledge_id}/dokumentes/{document_id}"
|
||||
|
||||
payload = {**fields}
|
||||
if update_last_sync:
|
||||
|
||||
Reference in New Issue
Block a user