# You'll have to gather the tokens on your own, or use# ./gather_keys_oauth2.pyauthd_client=fitbit.Fitbit('<consumer_key>','<consumer_secret>',access_token='<access_token>',refresh_token='<refresh_token>')authd_client.sleep()

Some assumptions you should note. Anywhere it says user_id=None,
it assumes the current user_id from the credentials given, and passes
a - through the API. Anywhere it says date=None, it should accept
either None or a date or datetime object
(anything with proper strftime will do), or a string formatted
as %Y-%m-%d.

Before using this class, create a Fitbit app
here. There you will get the client id
and secret needed to instantiate this class. When first authorizing a user,
make sure to pass the redirect_uri keyword arg so fitbit will know where
to return to when the authorization is complete. See
gather_keys_oauth2.py
for a reference implementation of the authorization process. You should
save access_token, refresh_token, and expires_at from the
returned token for each user you authorize.

When instantiating this class for use with an already authorized user, pass
in the access_token, refresh_token, and expires_at keyword
arguments. We also strongly recommend passing in a refresh_cb keyword
argument, which should be a function taking one argument: a token dict.
When that argument is present, we will automatically refresh the access
token when needed and call this function so that you can save the updated
token data. If you don’t save the updated information, then you could end
up with invalid access and refresh tokens, and the only way to recover from
that is to reauthorize the user.

The intraday time series extends the functionality of the regular time series, but returning data at a
more granular level for a single day, defaulting to 1 minute intervals. To access this feature, one must
fill out the Private Support form here (see https://dev.fitbit.com/docs/help/).
For details on the resources available and more information on how to get access, see: