Skip to content

Instantly share code, notes, and snippets.

@mc51
Created April 16, 2017 09:09
Show Gist options
  • Save mc51/dda490b0d39019ff291c80ccda2cc2ad to your computer and use it in GitHub Desktop.
Save mc51/dda490b0d39019ff291c80ccda2cc2ad to your computer and use it in GitHub Desktop.
def get_alexa_location():
API_URL = "https://api.eu.amazonalexa.com/v1/devices/{}/settings" \
"/address".format(context.System.device.deviceId)
TOKEN = context.System.user.permissions.consentToken # check if not empty! fall back
API_HEADER = {'Accept': 'application/json',
'Authorization': 'Bearer {}'.format(TOKEN)}
r = requests.get(API_URL, headers=API_HEADER)
if r.status_code == 200:
return(r.json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment