10-24-2016 23:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-24-2016 23:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
How do I retrieve longitude and latitude data with the use of python?
I saw "Get Activity TCX" and typed "Resource URLs".
-> Get Activity TCX...https://dev.fitbit.com/docs/activity/#get-activity-tcx
-> Resource URLs...https://api.fitbit.com/1/user/[user-id]/activities/[log-id].tcx
But error message below is displayed.
--------------------------------------------------
invalid_client - Invalid authorization header format.
Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API
authorization process.
--------------------------------------------------
I was getting user_id from the profile endpoint and log-id from Activity Logs List.
Please tell me what is a problem.
Answered! Go to the Best Answer.

Accepted Solutions
10-26-2016 10:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-26-2016 10:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@WA1 You'll need to send the access token, should be something like this:
Authorization: Bearer accesstokenforuser
10-25-2016 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-25-2016 11:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@WA1 Can I see the header you're setting?

10-25-2016 23:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-25-2016 23:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
My setting is as follows.
----------------------------------------------------------------------------
req = urllib2.Request('https://api.fitbit.com/1/user/4PNPB2/activities/4580023024.tcx')
req.add_header('content-type', 'application/vnd.garmin.tcx+xml; charset=utf8')
----------------------------------------------------------------------------
Thank you.

10-26-2016 10:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-26-2016 10:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@WA1 You'll need to send the access token, should be something like this:
Authorization: Bearer accesstokenforuser
10-26-2016 22:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-26-2016 22:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Oh!
I was able to get GPS data to send the access token.
Thank you so much!

10-27-2016 11:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-27-2016 11:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@WA1 Awesome, glad you got it figured out.

