DmitrMakeev
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -879,17 +879,17 @@ def update_or_insert_user(db_name, user_data, mapping_template):
|
|
879 |
def send_request():
|
880 |
token = request.form.get('token')
|
881 |
minDate = request.form.get('minDate')
|
882 |
-
|
|
|
883 |
type = request.form.get('type', 'LiveWebinars')
|
884 |
|
885 |
-
#
|
886 |
-
url = f'https://online.bizon365.ru/api/v1/webinars?
|
887 |
|
888 |
response = requests.get(url, headers={'X-Token': token})
|
889 |
|
890 |
if response.status_code == 200:
|
891 |
data = response.json()
|
892 |
-
# Здесь обработка данных и возврат ответа
|
893 |
return jsonify(data)
|
894 |
else:
|
895 |
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|
|
|
879 |
def send_request():
|
880 |
token = request.form.get('token')
|
881 |
minDate = request.form.get('minDate')
|
882 |
+
maxDate = request.form.get('maxDate')
|
883 |
+
limit = request.form.get('limit', 20)
|
884 |
type = request.form.get('type', 'LiveWebinars')
|
885 |
|
886 |
+
# Создание URL с параметрами
|
887 |
+
url = f'https://online.bizon365.ru/api/v1/webinars?type={type}&minDate={minDate}&maxDate={maxDate}&limit={limit}'
|
888 |
|
889 |
response = requests.get(url, headers={'X-Token': token})
|
890 |
|
891 |
if response.status_code == 200:
|
892 |
data = response.json()
|
|
|
893 |
return jsonify(data)
|
894 |
else:
|
895 |
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|