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

How can I get longitude and latitude data?

ANSWERED

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.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@WA1 You'll need to send the access token, should be something like this:

 

Authorization: Bearer accesstokenforuser
Andrew | Community Moderator, Fitbit

What motivates you?

View best answer in original post

Best Answer
5 REPLIES 5

@WA1 Can I see the header you're setting?

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

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.

 

Best Answer
0 Votes

@WA1 You'll need to send the access token, should be something like this:

 

Authorization: Bearer accesstokenforuser
Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer

Oh!
I was able to get GPS data to send the access token.

 

Thank you so much!

Best Answer
0 Votes

@WA1 Awesome, glad you got it figured out. Robot Very Happy

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes