ервый импорт проекта
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
API_KEY = 'B3526FC8-82CB-4798-92C8-22AF05F9A49F'
|
||||
BASE_URL = 'https://support.atl-group.ru/api/v3'
|
||||
|
||||
url = BASE_URL + '/requests'
|
||||
params = {
|
||||
'TECHNICIAN_KEY': API_KEY,
|
||||
'listInfo': json.dumps({
|
||||
'row_count': 100,
|
||||
'start_index': 1,
|
||||
'sort_field': 'id',
|
||||
'sort_order': 'asc'
|
||||
})
|
||||
}
|
||||
|
||||
resp = requests.get(url, params=params, timeout=30, verify=False)
|
||||
data = resp.json()
|
||||
|
||||
print('List info:')
|
||||
print(json.dumps(data.get('list_info', {}), indent=2))
|
||||
|
||||
requests_data = data.get('requests', [])
|
||||
print('Requests count:', len(requests_data))
|
||||
|
||||
if requests_data:
|
||||
first_id = requests_data[0].get('id')
|
||||
last_id = requests_data[-1].get('id')
|
||||
print('First ID:', first_id)
|
||||
print('Last ID:', last_id)
|
||||
Reference in New Issue
Block a user