Using R and the ROAuth package by Jeff Gentry to try and pull data off of fitbit and the Authentication doesn't seem to work. Code as follows:
apiURL = 'api.fitbit.com/'
credentials = OAuthFactory$new(consumerKey=key,
consumerSecret=secret,
requestURL=tokenURL,
accessURL=accessTokenURL,
authURL=authorizeURL
)
and then I run the handshake:
> credentials$handshake()
To enable the connection, please direct your web browser to:
http://www.fitbit.com/oauth/authorize?oauth_token=036afa88a832bfffc72af485e38c1572
When complete, record the PIN given to you and provide it here:
Complete the authorization and paste in the oauth_verifier token, resulting in a proper looking set of credentials.
Finally I try to get the profile data that I'm after:
rawToChar(credentials$OAuthRequest(paste(apiURL,"1/user/userID/profile.json", sep="", collapse=''), "GET"))
And I get this in response:
[1] "{\"errors\":[{\"errorType\":\"oauth\",\"fieldName\":\"n/a\",\"message\":\"No
Authorization header provided in the request. Each call to Fitbit API should be OAuth
signed\"}]}"