DmitrMakeev commited on
Commit
59e03d7
·
verified ·
1 Parent(s): 162361d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -764,6 +764,21 @@ def data_gc_tab_out():
764
 
765
 
766
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
 
768
 
769
 
 
764
 
765
 
766
 
767
+ @app.route('/send_request', methods=['POST'])
768
+ def send_request():
769
+ token = request.form.get('token')
770
+ min_date = request.form.get('minDate')
771
+ type = request.form.get('type')
772
+ url = f'https://online.bizon365.ru/api/v1/webinars/reports/getlist?minDate={min_date}&type={type}'
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