google-api-js-client

Method: people.get() does not return names

跟風遠走 提交于 2020-08-10 20:26:12
问题 I have a question regarding API: GET https://people.googleapis.com/v1/{resourceName=people/*} When the resourceName = people/account_id and the personFields is 'names' the API returns names only when the account_id has a Google+ account associated with it. For the account_id without associate Google+ account, no names are returned. My application scopes are: https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/plus.login Is

Method: people.get() does not return names

痞子三分冷 提交于 2020-08-10 20:24:37
问题 I have a question regarding API: GET https://people.googleapis.com/v1/{resourceName=people/*} When the resourceName = people/account_id and the personFields is 'names' the API returns names only when the account_id has a Google+ account associated with it. For the account_id without associate Google+ account, no names are returned. My application scopes are: https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/plus.login Is

Converting a class based component to hooks (gapi API)

一个人想着一个人 提交于 2020-08-09 09:45:27
问题 I have this class based component using the gapi (Google Auth) API that renders a button and it works: import React from 'react'; class GoogleAuth extends React.Component { state = { isSignedIn: null }; componentDidMount() { window.gapi.load('client:auth2', () => { window.gapi.client .init({ clientId: process.env.REACT_APP_CLIENT_ID, scope: 'email', }) .then(() => { this.auth = window.gapi.auth2.getAuthInstance(); this.handleAuthChange(); this.auth.isSignedIn.listen(this.handleAuthChange); })

Google Drive API V3 Javascript - Create File with Content

老子叫甜甜 提交于 2020-07-05 04:49:12
问题 This question has been asked before, but the answer was using API V2. The google documentation does not clarify how to create a file with its content using javascript client code. I tried using the code listed under Node, however, it only creates the file, it does not insert any content. Here is my code: let fileMetadata = { 'name': name, parents: [parentId] }; let media = { mimeType: 'text/plain', body: 'content inside file' }; gapi.client.drive.files.create({ resource: fileMetadata, media,

Google Drive API V3 Javascript - Create File with Content

情到浓时终转凉″ 提交于 2020-07-05 04:48:08
问题 This question has been asked before, but the answer was using API V2. The google documentation does not clarify how to create a file with its content using javascript client code. I tried using the code listed under Node, however, it only creates the file, it does not insert any content. Here is my code: let fileMetadata = { 'name': name, parents: [parentId] }; let media = { mimeType: 'text/plain', body: 'content inside file' }; gapi.client.drive.files.create({ resource: fileMetadata, media,

gapi login state not retained in users browser after page refresh

三世轮回 提交于 2020-06-25 03:31:33
问题 I've dove into a small project aiming to utilize the YouTube API. I've got some basic code in place, that I initially thought was, working properly. Using Chrome, I can login through multiple machines on my own network without any issues using the source below. I've also tethered my machines to my cellular network to ensure that the process also works properly outside of my own network. Unfortunately, I'm having issues finding out why a colleague (from a remote location) is unable to retain

setToken doesn't switch YouTube channel in Google API (gapi)

血红的双手。 提交于 2020-02-27 12:50:15
问题 I've got a problem that I cannot solve. I want to allow users to connect to multiple youtube channels at once and create youtube streams for them. The main code looks like this: export const setGapiTokenForTarget = async (token) => { await window.gapi.client.setToken(token); await window.gapi.auth.setToken(token); }; export const bindStreamToBroadcast = async (streamId, broadcastId, token) => { await setGapiTokenForTarget(token); return window.gapi.client.youtube.liveBroadcasts.bind({ 'id':

Google + Signin using Google java script client library

空扰寡人 提交于 2020-01-24 13:19:49
问题 I am doing googlre sign in in my app using gapi.auth.authorize({ client_id : clientId, scope : scopes, immediate : true }, handleAuthResult); I am able to authorize the user ,then i gave a link to gign out the user using this api gapi.auth.signOut(); it is also signing out the user, but when i refresh the page then it is not asking to sign in again. it is directly loading user account, i want to make it to ask user to again login. Can any body tell me how to do it. 回答1: If you are running on

Incremental combined authorization with Google SignIn for Server-Side Apps

独自空忆成欢 提交于 2020-01-12 06:14:29
问题 When login with Server-Side flow, or ask authorization for additional scopes, with auth2.grantOfflineAccess , the result access/refresh token is not getting combined with previous authorized scopes, overriding the previous ones. Even passing the param to js calls, e.g. auth2.grantOfflineAccess({'include_granted_scopes' : 'true', ...}) , the param include_granted_scopes=true is NOT added to the generated URL. When I manually append the param &include_granted_scopes=true to the generated url on