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

API CALL USING REST CLIENT

I am new to the development world and this is my first application. The login took me long enough ha, on to the hard part. The below call worked via apigee and cannot figure out how to fetch my user data. I know it has something to do with the redirect and maybe the "-" line where current_user.uid line is. I am not sure but if anyone has any insight it would be greatly appreciated. 

 

```

class ActivitiesController < ApplicationController
def index
data = fit_data
end

private

def fit_data(date: Date.today)
binding.pry
string = "Bearer #{current_user.access_token}"
response = RestClient.get "https://api.fitbit.com/1/user/#{current_user.uid}/activities/date/#{date}.json", {Authorization: string, Host: "api.fitbit.com", Connection: "Keep-Alive"}

output = JSON.parse(response)
end

```

Best Answer
0 Votes
0 REPLIES 0