我想获取从我的应用登录的用户的所有谷歌私人连接.我启用了Google People和Google Plus API.我设置了凭证API密钥,客户端ID和客户端密钥.我正在尝试获取用户连接的URL是
https://people.googleapis.com/v1/people/me/connections?fields=connections&key=api_key&access_token=access_token
Run Code Online (Sandbox Code Playgroud)
另外,我正在使用图书馆passport-google-oauth来获取用户access_token.以上网址中是否有任何我遗漏的内容.
我的谷歌验证码是
// send to google to do the authentication
// profile gets us their basic information including their name
// email gets their emails
app.get('/auth/google', passport.authenticate('google', {
scope: ['profile', 'email','https://www.googleapis.com/auth/contacts.readonly', 'https://www.googleapis.com/auth/contacts']
}));
// the callback after google has authenticated the user
app.get('/auth/google/callback',
passport.authenticate('google', {
successRedirect: '/profile',
failureRedirect: '/'
}));
Run Code Online (Sandbox Code Playgroud) google-api google-api-nodejs-client passport-google-oauth google-people