DmitrMakeev
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -616,33 +616,6 @@ def se_mes_f_gc():
|
|
616 |
|
617 |
|
618 |
|
619 |
-
@app.route('/biz_v', methods=['GET'])
|
620 |
-
def biz_v():
|
621 |
-
api_sys_control = request.args.get('api_sys')
|
622 |
-
if api_sys_control != api_key_sys:
|
623 |
-
return "EUR 22", 200
|
624 |
-
return render_template('biz_v.html')
|
625 |
-
|
626 |
-
@app.route('/send_request', methods=['POST'])
|
627 |
-
def send_request():
|
628 |
-
token = request.form.get('token')
|
629 |
-
url = 'https://online.bizon365.ru/api/v1/webinars/reports/getlist?maxDate=2021-08-06T00:00:00'
|
630 |
-
|
631 |
-
response = requests.get(url, headers={'X-Token': token})
|
632 |
-
|
633 |
-
if response.status_code == 200:
|
634 |
-
data = json.loads(response.text)
|
635 |
-
html_output = '<ul>'
|
636 |
-
for webinar in data['list']:
|
637 |
-
html_output += f'<li>Name: {webinar["name"]}, Webinar ID: {webinar["webinarId"]}, Type: {webinar["type"]}, Created: {webinar["created"]}, Participants: {webinar["count1"]}, Duration: {webinar["count2"]} minutes</li>'
|
638 |
-
html_output += '</ul>'
|
639 |
-
return html_output
|
640 |
-
else:
|
641 |
-
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|
642 |
-
|
643 |
-
if __name__ == '__main__':
|
644 |
-
app.run(debug=True)
|
645 |
-
|
646 |
|
647 |
|
648 |
|
|
|
616 |
|
617 |
|
618 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
|
620 |
|
621 |
|