Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Error" - when receive data from Inspire 3 via Pytnon API

Hello, I specially bought a FitBit since I was sure that it is the best solution for operating with Python. Few days I had the same problem.  When I make it in Python 
response = auth2_client.intraday_time_series('activities/heart', base_date='today', detail_level='1min')

I receive 

KeyError: 'errors'

So what was Done 

I created a local host 

Ron_Ron_2-1769160118124.png

I use the next main script to receive any data 

import fitbit
import gather_keys_oauth2 as oauth2


CLIENT_ID = 'CLIENT_ID '
CLIENT_SECRET = 'CLIENT_SECRET'
REDIRECT_URI = 'http://127.0.0.1:8080/'

server = oauth2.OAuth2Server(CLIENT_ID, CLIENT_SECRET, redirect_uri=REDIRECT_URI)
server.browser_authorize()
token_dict = server.fitbit.session.token
auth2_client = fitbit.Fitbit(CLIENT_ID, CLIENT_SECRET, oauth2_token=token_dict)
response = auth2_client.intraday_time_series('activities/heart', base_date='today', detail_level='1min')

print (response)

After that, when was openethe d web page with my local host, I confirmed permission to receive all data

Ron_Ron_1-1769159944849.png

But after I received in python ide the next result 

ENGINE Bus STOPPING

ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) shut down

ENGINE Removed handler for console events.

ENGINE Stopped thread 'Autoreloader'.

ENGINE Bus STOPPED

ENGINE Bus EXITING

ENGINE Waiting for child threads to terminate...

ENGINE Bus EXITED

ENGINE Waiting for thread Thread-14.

prepare send data

Error: 'errors'

 

 

I modified python script in dozens of different ways, used many samples from the working script from GitHub and Forums, but the result is always the same - Error

Fitbit synchronized with the mobile app, this info is visible in my Fitbit dashboard page 

 

Ron_Ron_3-1769160652304.png

How can it be solved?  It seems to me that I have already worked through all the options, what could I have missed?

 

 

 




Best Answer
0 Votes
0 REPLIES 0