Skip to content

Instantly share code, notes, and snippets.

@herrersystem
Last active October 4, 2016 19:41
Show Gist options
  • Save herrersystem/eb0d3cef9c51d34e1b09ae47ab611c40 to your computer and use it in GitHub Desktop.
Save herrersystem/eb0d3cef9c51d34e1b09ae47ab611c40 to your computer and use it in GitHub Desktop.
Freebox OS API - Register app and get authorization
#!/usr/bin/env python
from apize.decorators import apize_raw
api_url = 'http://mafreebox.freebox.fr/api/v3'
@apize_raw(api_url + '/login/authorize/', method='POST')
def get_authorization():
data = {
'app_id': 'fr.freebox.testappfree',
'app_name': 'testappfree',
'app_version': '0.0.1',
'device_name': 'mamachine'
}
return {'data': data, 'is_json': True}
if __name__ == '__main__':
response = get_authorization()
if response['data']['success']:
result = ['data']['result']
print('[Track ID] {}'.format(result['track_id']))
print('[App token] {}'.format(result['app_token']))
print('Appuyez sur la flèche droite du cadran de votre freebox')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment