Skip to content

Instantly share code, notes, and snippets.



Last active Aug 30, 2016
What would you like to do?
Bottle app for simple server-side Zendesk app (
from bottle import route, run, template, request, response, static_file
import requests
def send_iframe_html():
qs = request.query_string
response.set_cookie('my_app_params', qs)
return template('start', qs=qs)
def show_tasks():
access_token = "your_access_token"
header = {'Authorization': 'Bearer {}'.format(access_token)}
url = ''
r = requests.get(url, headers=header)
if r.status_code == 200:
tasks = r.json()
return template('list_tasks', list=tasks['data'])
msg = 'Problem with the request: {} {}'.format(r.status_code, r.reason)
qs = request.get_cookie('my_app_params')
return template('start', qs=qs, error_msg=msg)
def send_js(filename):
return static_file(filename, root='static/js')
run(host='localhost', port=8080, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment