Questions tagged [google-api-js-client]

This code is written by Google, this compact and efficient client library provides access to any of Google's RESTful APIs

Google APIs Client Library for JavaScript

Description

Written by Google, this compact and efficient client library provides access to any of Google's RESTful APIs. See below for a list of supported APIs.

Beta

This library is in Beta. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will make an effort to support the public and protected surface of the library and maintain backwards compatibility in the future. While we are still in Beta, we reserve the right to make incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), our intention is to deprecate and provide ample time for developers to update their code.

Features

The JavaScript client library supports these Google APIs.

The JavaScript client supports the following browser environments:

  • Chrome 8+
  • Firefox 3.5+
  • MSIE 8+
  • Safari 4+

The library supports the following authentication and authorization methods - OAuth2

Documentation

Links

637 questions
118
votes
12 answers

How can I access Google Sheet spreadsheets only with Javascript?

I want to access Google Spreadsheets using JavaScript only (no .NET, C#, Java, etc.) I came here and was shocked to know that there is NO API for JavaScript to access Google Sheets. Please tell me how to access (CREATE/EDIT/DELETE) Google Sheets…
88
votes
18 answers

Google API authentication: Not valid origin for the client

When making an auth request to the Google API (gapi), it's returning false on the checkOrigin. I have removed any client id's or anything that would link directly to my account and replaced it with a regex indicating what the data is for…
30
votes
8 answers

Angular Js and google api client.js (gapi)

It took me one day to make it works so I think my experience may be useful from someone. And maybe some others will find improvement. So I start angularJS two days ago. And I want it works with Google Cloud Endpoints to create a backend interface.…
25
votes
2 answers

Import gapi.auth2 in angular 2 typescript

I tried to import some classes or function from Google gapi.auth2 in typescript. But below code never works even I correctly added the gapi.auth2 types in typings directory. import { GoogleAuth } from 'gapi.auth2'; I always got error: Error TS2307:…
Shu Lin
  • 313
  • 1
  • 3
  • 8
17
votes
4 answers

How to get refresh token while using Google API JS Client

I have been trying to implement an app that would need user to grant access to Google Analytics. I have been following this tutorial: https://developers.google.com/analytics/solutions/articles/hello-analytics-api And at some other places there is…
Sambhav Sharma
  • 5,741
  • 9
  • 53
  • 95
16
votes
0 answers

Google Sign-In gives error when swiching to secondary Youtube accounts

I am currently trying to use gapi.auth2 from Google Sign-In for Websites API and this is the code I have: -- load the library with: -- initialize…
16
votes
7 answers

Google Contacts API with Google JavaScript Client Lib

I am trying to work with the Google Contacts API v3. Because of the OAuth2 authentication and authorization I'm started with the Google APIs Client Library for JavaScript. I have no problems with that part of the API access. But after doing the…
15
votes
3 answers

Cannot read property 'style' of null - Google Sign-In Button

I'm trying to implement Google sign in for my website. The Sign-In button shows up correctly and signs-people in well initially. My problem occurs when I log out after having used the website and try to move to the Sign-In page (I'm using React, so…
14
votes
1 answer

Is there any way to execute gapi.client.request synchronously?

jQuery allows to send http request as synchronous (async:false setting), this is particularly useful when bypassing popup blocker. Is there any way to do this when using Google's javascript client library Gapi ?
13
votes
2 answers

How to upload files to Google drive using gapi and resumable uploads?

I'm trying to follow this guide for doing resumable uploads on Google Drive through Google Api's. This is my code, you can see it makes 2 requests as the guide asks to, the first part creates the metadata, and then we use the location for starting…
Luca Trazzi
  • 1,240
  • 1
  • 13
  • 30
13
votes
4 answers

google sign-in with angular2 and typescript - where to get gapi?

I'm trying to use google sign-in with angular2 by following this question: Google Sign-In for Websites and Angular 2 using Typescript But I'm getting an error: ORIGINAL EXCEPTION: ReferenceError: gapi is not defined ORIGINAL…
NDevox
  • 4,056
  • 4
  • 21
  • 36
12
votes
5 answers

How does Google's javascript API get around the cross-domain security in AJAX

How does Google's API make cross-domain requests back to Google, when it's on your website?
Arron S
  • 5,511
  • 7
  • 50
  • 57
11
votes
5 answers

I got this issue when, I am trying to run this code (gapi.auth2.getAuthInstance().signIn();) "idpiframe_initialization_failed"

error: 'idpiframe_initialization_failed', details: 'You have created a new client application that use…i/web/guides/gis-migration) for more information.'} details: "You have created a new client application that uses libraries for user…
11
votes
1 answer

gapi.client.load versus google.load

I am confused about how to properly load Google's APIs. I see mentioned two different approaches: First: Google API loader (https://developers.google.com/loader). I see this used like so within the html document:
Who8MyLunch
  • 1,190
  • 14
  • 20
10
votes
3 answers

How to use gapi in react

I want to use gapi to access people api resources from google, I tried many ways to do the job, but I still cannot get any response. It has not error, no warning. Here is my code. loadYoutubeApi() { const script =…
Darren
  • 145
  • 1
  • 1
  • 13
1
2 3
42 43