DmitrMakeev commited on
Commit
bc98c26
·
verified ·
1 Parent(s): 5dd4a46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -744,6 +744,22 @@ def data_gc_tab_out():
744
 
745
 
746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
 
748
 
749
 
@@ -764,21 +780,6 @@ def data_gc_tab_out():
764
 
765
 
766
 
767
-
768
- @app.route('/send_request', methods=['POST'])
769
- def send_request():
770
- token = request.form.get('token')
771
- min_date = request.form.get('minDate')
772
- url = f'https://online.bizon365.ru/api/v1/webinars/reports/getlist?minDate={min_date}'
773
-
774
- response = requests.get(url, headers={'X-Token': token})
775
-
776
- if response.status_code == 200:
777
- data = response.json()
778
- webinar_ids = [item['webinarId'] for item in data['list']]
779
- return jsonify(webinar_ids)
780
- else:
781
- return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
782
 
783
 
784
 
 
744
 
745
 
746
 
747
+ app.route('/send_request', methods=['POST'])
748
+ def send_request():
749
+ token = request.form.get('token')
750
+ min_date = request.form.get('minDate')
751
+ limit = request.form.get('limit', '20')
752
+ webinar_type = request.form.get('type', 'LiveWebinars')
753
+ url = f'https://online.bizon365.ru/api/v1/webinars/reports/getlist?minDate={min_date}&limit={limit}&type={webinar_type}'
754
+
755
+ response = requests.get(url, headers={'X-Token': token})
756
+
757
+ if response.status_code == 200:
758
+ data = response.json()
759
+ webinar_ids = [item['webinarId'] for item in data['list']]
760
+ return jsonify(webinar_ids)
761
+ else:
762
+ return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
763
 
764
 
765
 
 
780
 
781
 
782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
783
 
784
 
785