httr library을 사용하여 fitbit API에 연결하려고합니다. 제공된 예를 사용httt를 사용하여 Fitbit에 Oauth 인증
, 다음 코드를 내놓았다 :
library(httr)
key <- '<edited>'
secret <- '<edited>'
tokenURL <- 'http://api.fitbit.com/oauth/request_token'
accessTokenURL <- 'http://api.fitbit.com/oauth/access_token'
authorizeURL <- 'https://www.fitbit.com/oauth/authorize'
fbr <- oauth_app('fitbitR',key,secret)
fitbit <- oauth_endpoint(tokenURL,authorizeURL,accessTokenURL)
token <- oauth1.0_token(fitbit,fbr)
sig <- sign_oauth1.0(fbr,
token=token$oauth_token,
token_secret=token$oauth_token_secret
)
내가
인증이 완료 얻을. HTTR에서 메시지,하지만 API에 액세스하려고하면 오류 메시지가
GET("http://api.fitbit.com/1/user/-/activities/date/2012-08-29.json", sig)
Response [http://api.fitbit.com/1/user/-/activities/date/2012-08-29.json]
Status: 401
Content-type: application/x-www-form-urlencoded;charset=UTF-8
{"errors":[{"errorType":"oauth","fieldName":"oauth_access_token","message":"Invalid signature or token '<edited>' or token '<edited>'"}]}
에게 문제가 무엇인지에 대한 단서를 던져?
"curlEscape에 대한 호출을 curlPercentEncode로 대체하는 방법에 대한 예제 코드를 제공하여 답변을 확장 해주십시오. "? –
이것이 무슨 뜻인지 설명해 주시겠습니까? ('httr'의 구현이 변경된 것 같기 때문에 여전히 관련이 있는지 확신 할 수 없지만). –