Skip to content

Instantly share code, notes, and snippets.

@GetOsmosis
GetOsmosis / Osmosis-Python-Connection.py
Created December 16, 2013 02:07
Connecting to Osmosis Questionnaires with Python
import urllib2
import simplejson
api_key = '<insert your API key here>'
url = 'https://www.getosmosis.com/api/Questionnaires/Draft?key=' + api_key
req = urllib2.Request(url, None, {'user-agent':'osmosis/api'})
opener = urllib2.build_opener()
f = opener.open(req)
print simplejson.load(f)