Files
platform-project/modules/request-module/check_conversations3.py
alex 6c86f0f571 TT-003: complete request-module integration into modular platform
- integrated request-module into module registry
- moved backend into modules/request-module
- added manifest.json and module.py
- implemented dynamic router mounting
- implemented dynamic static mounting
- removed direct dependencies from platform core
- verified startup with request-module
- verified startup without request-module
- added implementation_report_003.md
2026-08-06 16:31:27 +03:00

55 lines
2.0 KiB
Python

import json
import requests
API_KEY = 'B3526FC8-82CB-4798-92C8-22AF05F9A49F'
BASE_URL = 'https://support.atl-group.ru/api/v3'
import urllib3
urllib3.disable_warnings()
# Try to find a ticket with conversations
with open('migrations/scripts/extracted_data.json', 'r', encoding='utf-8') as f:
data = json.load(f)
# Check tickets with has_conversation flag
for ticket in data['tickets'][:20]:
tid = ticket['ticket_id']
# Get full details
url = f'{BASE_URL}/requests/{tid}'
params = {'TECHNICIAN_KEY': API_KEY}
resp = requests.get(url, params=params, timeout=30, verify=False)
full_data = resp.json()
if 'request' in full_data:
req = full_data['request']
has_conv = req.get('has_conversation', False)
has_notes = req.get('has_notes', False)
if has_conv or has_notes:
print(f'Ticket #{tid}: has_conversation={has_conv}, has_notes={has_notes}')
print(f' Subject: {req.get("subject", "")[:60]}')
# Try conversations endpoint
conv_url = f'{BASE_URL}/requests/{tid}/conversations'
resp2 = requests.get(conv_url, params=params, timeout=30, verify=False)
if resp2.status_code == 200:
conv_data = resp2.json()
convs = conv_data.get('conversations', [])
print(f' Conversations: {len(convs)}')
if convs:
print(f' First conv keys: {list(convs[0].keys())}')
# Try notes endpoint
notes_url = f'{BASE_URL}/requests/{tid}/notes'
resp3 = requests.get(notes_url, params=params, timeout=30, verify=False)
if resp3.status_code == 200:
notes_data = resp3.json()
notes = notes_data.get('notes', [])
print(f' Notes: {len(notes)}')
if notes:
print(f' First note keys: {list(notes[0].keys())}')
print()