Last active
October 4, 2016 19:41
-
-
Save herrersystem/eb0d3cef9c51d34e1b09ae47ab611c40 to your computer and use it in GitHub Desktop.
Freebox OS API - Register app and get authorization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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