DmitrMakeev commited on
Commit
c6b2825
1 Parent(s): df02dbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py CHANGED
@@ -728,7 +728,34 @@ def data_gc_tab_out():
728
 
729
 
730
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
 
733
 
734
 
 
728
 
729
 
730
 
731
+ @app.route('/send_request', methods=['POST'])
732
+ def send_request():
733
+ token = request.form.get('token')
734
+ min_date = request.form.get('minDate')
735
+ url = f'https://online.bizon365.ru/api/v1/webinars/reports/getlist?minDate={min_date}'
736
+
737
+ response = requests.get(url, headers={'X-Token': token})
738
+
739
+ if response.status_code == 200:
740
+ data = response.json()
741
+ webinar_ids = [item['webinarId'] for item in data['list']]
742
+ return jsonify(webinar_ids)
743
+ else:
744
+ return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
745
 
746
+ @app.route('/send_get_request', methods=['GET'])
747
+ def send_get_request():
748
+ token = request.args.get('token')
749
+ webinarId = request.args.get('webinarId')
750
+ url = f'https://online.bizon365.ru/api/v1/webinars/reports/get?webinarId={webinarId}'
751
+
752
+ response = requests.get(url, headers={'X-Token': token})
753
+
754
+ if response.status_code == 200:
755
+ data = response.json()
756
+ return jsonify(data)
757
+ else:
758
+ return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
759
 
760
 
761