ruby on rails - Google contacts API 401 error RestClient::Unauthorized -


i want retrieve google contacts user in ruby on rails using restclient, every time tried, face restclient 401 unauthorized error on query line. assume query wrong or missgin something, didn't find usefull in google contact api doc. idea ?

here's scope

scope = 'https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile+https://www.google.com/m8/feeds/contacts/default/full/+https://mail.google.com/mail/feed/atom/+https://www.googleapis.com/auth/calendar' 

here's method call freshly received access_token

def import_google_contact(user_email, access_token)   r = restclient.get "https://www.google.com/m8/feeds/contacts/#{user_email}/full?access_token=#{access_token}"   ... end 

which weird since manage user email before in same method using request

r = restclient.get "https://www.googleapis.com/oauth2/v2/userinfo?access_token=#{access_token}" 

i discovered didn't put right parameter in scope request contacts data? replaced

https://www.google.com/m8/feeds 

this weird because google accepts wrong 1 during authorization process


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -