Initial monorepo structure
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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()
|
||||
|
||||
# Get conversation content
|
||||
url = f'{BASE_URL}/requests/24'
|
||||
params = {'TECHNICIAN_KEY': API_KEY}
|
||||
|
||||
resp = requests.get(url, params=params, timeout=30, verify=False)
|
||||
data = resp.json()
|
||||
|
||||
if 'request' in data:
|
||||
req = data['request']
|
||||
|
||||
# Get conversations list
|
||||
conv_url = f'{BASE_URL}/requests/24/conversations'
|
||||
resp2 = requests.get(conv_url, params=params, timeout=30, verify=False)
|
||||
conv_data = resp2.json()
|
||||
|
||||
convs = conv_data.get('conversations', [])
|
||||
print(f'Conversations: {len(convs)}')
|
||||
|
||||
for conv in convs:
|
||||
print(f'\nConversation #{conv["id"]}:')
|
||||
print(f' Type: {conv.get("type")}')
|
||||
print(f' From: {conv.get("from")}')
|
||||
print(f' Sent time: {conv.get("sent_time")}')
|
||||
print(f' Content URL: {conv.get("content_url")}')
|
||||
|
||||
# Get content
|
||||
content_url = conv.get('content_url')
|
||||
if content_url:
|
||||
full_url = f'https://support.atl-group.ru{content_url}'
|
||||
resp3 = requests.get(full_url, params=params, timeout=30, verify=False)
|
||||
print(f' Content status: {resp3.status_code}')
|
||||
if resp3.status_code == 200:
|
||||
content = resp3.json()
|
||||
print(f' Content keys: {list(content.keys())}')
|
||||
if 'conversation' in content:
|
||||
conv_detail = content['conversation']
|
||||
print(f' Detail keys: {list(conv_detail.keys())}')
|
||||
print(f' Description length: {len(conv_detail.get("description", ""))} chars')
|
||||
print(f' Description preview: {conv_detail.get("description", "")[:200]}')
|
||||
Reference in New Issue
Block a user