Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def make_request(path, method, payload=None):
# Use API Key and API Token that you've copied from
# your settings page.
headers = {
'apikey': '',
'apitoken': 'c18888888888888888888fa135f540',
# This is the root URL. All API calls are relative to this URL.
base_url = ""
# We append the path into base_url
url = "".join([base_url, path])
# HTTP GET for getting data
if method == 'get':
result = requests.get(url, headers=headers)
# HTTP POST for usually creating new data and editing data.
elif method == 'post':
result =, data=payload, headers=headers)
raise NotImplementedError
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.