Git Product home page Git Product logo

google-api-javascript-client's Introduction

Google API Client Library for JavaScript

Description

The Google API Client Library for JavaScript is designed for JavaScript client-application developers. It offers simple, flexible access to many Google APIs.

Note: This repo does not contain the source code for the gapi client.

Features

The JavaScript client library supports these Google APIs.

If you use TypeScript, you can install @types/gapi for autocompletion.

Documentation

Guides

Links

google-api-javascript-client's People

Contributors

bochunz avatar bsittler avatar bwobrien avatar chirags avatar cxong avatar dvanderb avatar eesheesh avatar grant avatar induratized avatar kevinthecheung avatar nielm avatar piperchester avatar richardkmichael avatar silvolu avatar smarquardt avatar talkor avatar tmsch avatar valtism avatar wonderfly avatar wora avatar wwwebman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-api-javascript-client's Issues

gapi.auth.init(callback) Problem with Popup-Blocker

From [email protected] on March 15, 2012 08:15:51

According to the documentation at: https://code.google.com/p/google-api-javascript-client/wiki/ReferenceDocs we should use
gapi.auth.init(callback)
The instruction there is "Initializes the authorization feature. Call this when the client loads to prevent popup blockers from blocking the auth window on gapi.auth.authorize() calls."

I have
gapi.client.load('plus', 'v1', function () { });
gapi.auth.init(initCallBack);
function initCallBack(result)
{

}

BUT the auth window is still not shown UNLESS I specifically turn off "pop-up blocker" in the mobile browser (iPhone)

I thought the documentation means gapi.auth.init is supposed to correct this problem.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=22

Authentication issue with MSIE 8 and scopeS

From [email protected] on July 24, 2012 12:14:36

What steps will reproduce the problem?

  1. use the [authSample script] https://code.google.com/p/google-api-javascript-client/source/browse/samples/authSample.html ;
  2. set multiple scopes instead of ' https://www.googleapis.com/auth/plus.me'; for example:
    var scopes = [
    ' https://www.googleapis.com/auth/drive.file' ,
    ' https://www.googleapis.com/auth/userinfo.email' ,
    ' https://www.googleapis.com/auth/userinfo.profile' ];
  3. Save, Run and Click the "Authorize" button.

What is the expected output?

  1. An optional sign in
  2. A pop-up window describing the requested authorizations

What do you see instead?

  1. A blank pop-up window
  2. Displaying the source shows a html What version of the product are you using? On what operating system? Drive v2, oAuth v2, MSIE 8 / Windows 7 Please provide any additional information below. 1. To be honest, this works fine with Chrome and Firefox.
  3. -key (MSIE Developer Tools) didn't help me

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=42

gapi fails to load when use locally (not on a webserver)

From Matthew.Schott on August 10, 2012 08:49:13

Load the code in the linked fiddle as a local webpage (ie file:///home/test.html).
Fiddle: http://jsfiddle.net/glitchtechscience/LsAwT/2/ What is the expected output? What do you see instead? I should see two alerts. I do see two on a web server, but when run locally (html5 app), it fails with the message "Unable to post message to file://. Recipient has origin null.". What version of the product are you using? On what operating system? Latest. Chromium 18 on Ubuntu 12.04.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=46

authSample.html demo is broken

From [email protected] on February 20, 2012 23:48:18

What steps will reproduce the problem? 1. http://google-api-javascript-client.googlecode.com/hg/samples/authSample.html 2. https://accounts.google.com/o/oauth2/auth?client_id=837050751313&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me&immediate=true&redirect_uri=postmessage&origin=http%3A%2F%2Fgoogle-api-javascript-client.googlecode.com&proxy=oauth2relay652472535&response_type=token&state=457442579&authuser=0Failed to load resource: the server responded with a status of 400 (Bad Request) What is the expected output? What do you see instead? Not a 400 What version of the product are you using? On what operating system? Mac Please provide any additional information below.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=14

Can not call gapi.auth.authorize with immediate: false followed by immediate: true (if 1st auth fails)

From [email protected] on July 31, 2012 23:16:05

Hi all,
i'm trying to build a function, called when a button needing a google api feature is clicked. The function :

  1. check the oauth token state using gapi.auth.authorize with immediate: false
  2. if auth fails (because user is disconnected from google) call gapi.auth.authorize with immediate: false to display the login dialog.

I'm testing using Chrome.
gapi.auth.init is called correctly.

Result:

if the function do only 2) it works perfectly. No popup blocker stops the popup. But if the user is connected and the app is authorized a popup is always displayed and closes automatically (it flickers). On iPhone this opens a new safari window which diseappar quickly.

if the function do 1) and the user is already connected and the app authorized it works perfectly. No popup is displayed.

if the function do 1) and auth fails, then do 2), the popup blocker is always blocking the auth popup.

There is no problem with the facebook api which does the same (method: FB.getLoginStatus with second parameter set to true).

Any idea ?

Code:

        gapi.auth.authorize({ client_id: GaHelper.clientId, scope: scopes, immediate: false }, 
            function(authResult) {
                if(authResult && !authResult.error) {
                    //auth ok
                } 
                else {
                    gapi.auth.authorize({ client_id: GaHelper.clientId, scope: scopes, immediate: false },
                        function(authResult2) {
                            if(authResult2 && !authResult2.error)
                                //auth ok
                        }
                    );
                }
            }
        );

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=44

getting 404 error on insert,update

From [email protected] on May 05, 2012 05:59:54

gapi.client.load('calendar', 'v3', function() {
var calrqst = gapi.client.calendar.calendars.insert({ 'resource': Calresource});

calrqst.execute(function(resp) {
console.log(resp);
});

i am using above code and when i try to run it from function the 404 not found message is coming from google api ..can you please help me this is very urgent any help will be appreciated

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=33

Error on calling gapi.client.request

From [email protected] on January 18, 2012 09:27:47

What steps will reproduce the problem? 1. request_json = {
path: "/tasks/v1/lists/@default/tasks/" + taskid,
method: "DELETE",
params: "",
body: ""
};
2. request = gapi.client.request(request_json);
3. request.execute(() What is the expected output? What do you see instead? Expected output is:
no error

Actual output:

Uncaught Error: Q`
GP_aplus.google.com:2
GP_Shplus.google.com:269
(anonymous function)plus.google.com:277
(anonymous function)plus.google.com:227
(anonymous function)plus.google.com:277
k.(anonymous function).l.(anonymous function).l.(anonymous function)plus.google.com:202
q.__cbplus.google.com:143
eplus.google.com:137
b What version of the product are you using? On what operating system? Current version
Mac OS
Chrome Browser Please provide any additional information below.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=6

iPhone Safari not firing callback from gapi.auth.authorize

From [email protected] on May 07, 2012 04:47:10

What steps will reproduce the problem? 1. go to http://11.gaevolution.appspot.com 2. Click Login button
3. Login to the popup window with your google credentials What is the expected output? What do you see instead? The popup should close and the original window should fire the callback from the gapi.auth.authorize function. On the iPhone the callback never fires from the authorize request. It works fine in iPad, but it is not working on iPhone 4 What version of the product are you using? On what operating system? Desktop all browsers - Works
iPad - iOS 5.1 - Works
Blackberry Playbook - Works
iPhone 4 - iOS 5.1 - FAIL Please provide any additional information below. I have tried this on two different iPhones and neither of them worked with the login popup.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=35

gapi.auth.authorize FAILURE on mobile devive

From [email protected] on March 14, 2012 15:11:09

If I navigate to my test link from my brower (IE, Chrome, Firefox) and click a button my app authorises and I get a login screen for the user.

Navigationg to the SAME site using my iPhone browser does not work. I see the spinner image for a while and then it vanishes and nothing happens.

The user login screen does not come up.
Sampel code

        function authorizeMe()
          {
              alert('in check auth -- before load client');
              gapi.client.load('plus', 'v1', function () { });
              gapi.client.setApiKey("12345678-not my real key");
    setTimeout(function () {
        gapi.auth.authorize({
            'client_id': '123456-blablablabla-bla.apps.googleusercontent.com',
            'scope': [" https://www.googleapis.com/auth/plus.me ", " https://www.googleapis.com/auth/userinfo.email ",
            " https://www.googleapis.com/auth/userinfo.profile" ],
            'response_type': 'token'
        }, handleAuthResult);
    }, 1);

The handleAuthResult() function does not get called when on the mobile device. THis happens with/without setting the app key

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=21

Library does not seem to handle non google api requests

From [email protected] on February 05, 2012 12:44:15

What steps will reproduce the problem? 1. Create request using gapi.client.request (modify the path).
var httpRequest = gapi.client.request({
'path': " http://www.foo.com/test/path ",
'params': {value: 2},
'method': "GET"
});
httpRequest.execute(yourCallback);

  1. Or (modify the path & root).
    var httpRequest = gapi.client.request({
    'root': 'http://www.foo.com'
    'path': '/test/path',
    'params': {value: 2},
    'method': "GET"
    });
    httpRequest.execute(yourCallback);

What is the expected output?
I expect to see a successful request to [ http://www.foo.com/test/path?value=2 ] in standard or proxy form in both examples.

What do you see instead?
In example 1:
First I see a request to [ https://www.googleapis.com/static/proxy.html?jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3DtT1-IQy6e20.en.%2Fsv%3D1%2Fam%3D!uXA1SJUHioGIFdxJYA%2Fd%3D1%2F#parent=http%3A%2F%2Flocalhost&rpctoken=814685473 ]

After that I see a request to [ https://apis.google.com//apps-static//js/gapi/googleapis_proxy/rt=j/ver=tT1-IQy6e20.en./sv=1/am=!uXA1SJUHioGIFdxJYA/d=1/ ]

Finally I see a request (comes back as 404) to [ https://www.googleapis.com/http%3A//www.foo.com/test/path?value=2 ]

In example 2:
I see a request (comes back as 404) to [ http://www.foo.com/static/proxy.html?jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3DtT1-IQy6e20.en.%2Fsv%3D1%2Fam%3D!uXA1SJUHioGIFdxJYA%2Fd%3D1%2F#parent=http%3A%2F%2Flocalhost&rpctoken=1375632388 ] What version of the product are you using? On what operating system? Current version at [ https://apis.google.com/js/client.js ].
I'm on Windows 7. In the Chrome Browser.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=10

gapi.auth.authorize callback doesn't get called when user closes window

From phenome on March 27, 2012 11:47:59

What steps will reproduce the problem? 1. Fire gapi.auth.authorize(). Wait for popup to open
2. Close the window What is the expected output? What do you see instead? Callback should be called with null parameter, or a token object with error, as per API.

When you DENY the authorization, the callback gets called with null.
::: Reading the API I assumed it would get called with a token object with the error parameter set. Is it really misleading or my interpretation is lacking?

I actually have no problem with it being called with null, but since there are two cases (the user actively DENYING authorization, or simply closing the window), it would be nice to get a token object with an error describing what happened.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=23

oauthuser=0 at the end of querystring causes an error if you have multiple google accounts

From [email protected] on March 10, 2012 14:01:10

What steps will reproduce the problem? 1.Have multiple google accounts
2. Call gapi.auth.authorize function
3. Popup appears with an error. If you remove oauthuser=0 from the querystring, no error and then you have an option which google account to choose. What is the expected output? What do you see instead? I should be able to see 'Allow' permissions window, but see google error instead. What version of the product are you using? On what operating system? windows8, Firefox Please provide any additional information below.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=19

'immediate' : true in config passes authorization but returns errors in rpc's

From [email protected] on April 27, 2012 07:33:37

What steps will reproduce the problem? 1. User is logged out from Google accounts 2. var config = {
'client_id' : '...',
'immediate' : true,
'scope' : ' https://www.googleapis.com/auth/analytics.readonly' }

gapi.auth.authorize(config, function () {
gapi.client.load('analytics', 'v3', success_loading_api);
});

  1. success_loading_api (arbitrary callback name) is called.
  2. gapi.client.analytics.data.ga.get(request_params).execute(callback);
  3. the request results in a JSON response with an error message.

It would be nice if the user was prompted with the login screen like when 'immediate' is false, when they're not logged in.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=28

CORS request fail while trying to download file using exportUrl - Drive API

From [email protected] on August 19, 2012 05:58:47

What steps will reproduce the problem? If possible, provide a live demo of the issue. 1.Go to http://makkarlabs.in/badgeit and click on start(authentication happens).
On the next page, I am able to select an image from my drive and load into the doc (here I use the "downloadUrl" returned by the object).
Whereas when I try to do the same with the "exportUrl" returned by the gapi request method I am getting cross origin error. What is the expected output? What do you see instead? I expect the file to be downloaded since Google APIs support CORS.
Instead I see
XMLHttpRequest cannot load https://docs.google.com/feeds/download/spreadsheets/Export?key=file-key&exportFormat=csv&access_token=my_access_token . Origin http://makkarlabs.in is not allowed by Access-Control-Allow-Origin. What version of the product are you using? On what operating system? Am on latest version of Chrome.
Windows 7 OS Please provide any additional information below.

Attachment: errorscreenshot.png

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=47

user_id is ignored and wrong token returned

From [email protected] on September 28, 2012 22:27:59

What steps will reproduce the problem? If possible, provide a live demo of the issue. 1. Call gapi.auth.authorize with user_id: '[email protected]'
2. Use the returned access token to get a files list from Drive
3. The list returned is for a different logged in user '[email protected]' What is the expected output? What do you see instead? I expect the files returned to be those of [email protected] What version of the product are you using? On what operating system? The client library doesn't reveal a version, which is another bug Please provide any additional information below. From Firebug ...
AUTH REQUEST

authuser 0
client_id 6**5.apps.googleusercontent.com
immediate true
origin http://dev.clevernote.co:8888 proxy oauth2relay1602846100
redirect_uri postmessage
response_type token
scope https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://docs.googleusercontent.com/ https://docs.google.com/feeds/ https://www.googleapis.com/auth/drive.install state 1095436933
user_id [email protected]

AUTH RESPONSE

<title>Connecting ...</title><script type="text/javascript" src=" https://oauth.googleusercontent.com/gadgets/js/core:rpc:shindig.random:shindig.sha1.js?c=2"></script><script type="text/javascript" src=" https://ssl.gstatic.com/accounts/o/1235607322-postmessage.js"></script>

So the access token is ya29.AHES6ZTykQLvUIA3Xg1md0hjf0q8Xrw2tAzTtQ4DMNuXESnr

DRIVE REQUEST
-------------- https://www.googleapis.com/drive/v2/files?q=hidden&#37;20&#37;3D&#37;20false&#37;20and&#37;20trashed&#37;3Dfalse&#37;20&#37;20and&#37;20&#37;27root&#37;27&#37;20in&#37;20parents&#37;20&#37;20and&#37;20mimeType&#37;20&#37;3D&#37;20&#37;27application&#37;2Fvnd.google-apps.folder&#37;27 Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Authorization Bearer ya29.AHES6ZTykQLvUIA3Xg1md0hjf0q8Xrw2tAzTtQ4DMNuXESnr
Connection keep-alive
Host www.googleapis.com
Referer https://www.googleapis.com/static/proxy.html?jsh=m&#37;3B&#37;2F_&#37;2Fapps-static&#37;2F_&#37;2Fjs&#37;2Fgapi&#37;2F__features__&#37;2Frt&#37;3Dj&#37;2Fver&#37;3DjmGebzOE3Rg.en_GB.&#37;2Fsv&#37;3D1&#37;2Fam&#37;3D!CVDWKorrwvOYBs7wcQ&#37;2Fd&#37;3D1&#37;2Frs&#37;3DAItRSTNS2d2UFqqYKS9now9NCvzlmDFZ2g User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1
X-ClientDetails appVersion=5.0%20(X11)&platform=Linux%20x86_64&userAgent=Mozilla%2F5.0%20(X11%3B%20Linux%20x86_64%3B%20rv%3A14.0)%20Gecko%2F20100101%20Firefox%2F14.0.1
X-JavaScript-User-Agent google-api-javascript-client/1.1.0-beta
X-Origin http://dev.clevernote.co:8888 X-Referer http://dev.clevernote.co:8888 DRIVE RESPONSE

{
"kind": "drive#fileList",
"etag": ""VEU5fga3uYlZRf0pG-N1kS4iWP4/tFR8g3q2cieJV0ZDajei0GPtGsA"",
"selfLink": " https://www.googleapis.com/drive/v2/files?q=hidden+&#37;3D+false+and+trashed&#37;3Dfalse++and+'root'+in+parents++and+mimeType+&#37;3D+'application/vnd.google-apps.folder' ",
"items": [
{
"kind": "drive#file",
"id": "0B5fJaq3WEtJ1YTE5OTYzZjUtZjdmZi00YTVmLThhNTYtYzhkZGU0MWJiMjQz",
---------- response truncated -------------------

The file ID "0B5fJaq3WEtJ1YTE5OTYzZjUtZjdmZi00YTVmLThhNTYtYzhkZGU0MWJiMjQz", and all the other items returned are owned by [email protected]. [email protected] has no access

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=49

JS Client does not work in Gadget setting

From [email protected] on December 20, 2011 11:19:40

What steps will reproduce the problem? 1. Include the JS Client in a Gadget
2. Load the Gadget (iGoogle, Calendar, etc.). What is the expected output? What do you see instead? Expected: Calls using the JS Client work as usual.
Actual: JS error in the console, and the JS Client calls (gapi.client., gapi.auth.) do not work.

Sample JS Error (IE9):

SCRIPT5009: 'GP_D' is undefined
d=1, line 171 character 466
SCRIPT5007: Unable to get value of the property 'authorize': object is null
or undefined
www.google.com&libs=core:core.io:core.iglegacy:auth-refresh&is_signed...,
line 156 character 3

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=3

fusiontables.query.sql({sql:query}).execute() doesn't run callback if NaN is the in rpc response.

From [email protected] on July 31, 2012 13:16:31

What steps will reproduce the problem? If possible, provide a live demo of the issue. 1. There appears to be an issue parsing NaN from the response:
var query = 'SELECT * FROM 1_4R0hkTYJNFueoVRMxYNz0ajETQn6c8BLBxnnA LIMIT 10'
gapi.client.fusiontables.query.sql({sql:query}).execute(function(response) { console.log(response);});

It looks like there is a NaN in the response if a numeric column is left blank:
[
{
"result": {
"kind": "fusiontables#sqlresponse",
"columns": [
"Accident Num",
"County",
"Primary Street Name",
"Secondary Street Name",
"Crash Severity",
"Crash Year",
"Crash Day",
"Crash Hour Range",
"NM Non Motor Type",
"Injured Status",
"Injured Status Code",
"DOB",
"Age",
"NM Non Motor Action",
"Urban Rural",
"Alc Drug Susp",
"NM Factors",
"NM Loc Prior Impact",
"Non Motorist Rec Num",
"Accident Rec Num",
"lat",
"long",
"address"
],
"rows": [
[
"BCPD080693",
"CLARK",
"ALBERTSONS PARKING LOT",
"82 FEET NORTH OF SOUTH CURBLINE",
"Injury Accident",
"2000",
"SAT",
"12:00AM - 02:59AM",
"Pedestrian",
"Non-incapacitating",
"B",
"19-May-2008",
"3",
"Walking",
"U",
"Neither",
"",
"",
"12342",
"1774079",
"",
NaN, <--- When I change the value it works
""
]
...
},
"id": "gapiRpc"
}
] What is the expected output? What do you see instead? Expected output (from Chrome console):

Object
columns: Array[23]
kind: "fusiontables#sqlresponse"
result: Object
rows: Array[10]
proto: Object

Output:
Nothing (Blank)

I think it should at least throw an error. What version of the product are you using? On what operating system? Chrome Version 21.0.1180.57 beta (Linux)
Firefox 14.0.1 (Linux) Please provide any additional information below. Here is a table that will cause the client to silently fail: https://www.google.com/fusiontables/DataSource?docid=11bs75rfGCQJEKuoQu_N8A4l56lHPVHOYvxhoIek

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=43

gapi.auth.init(callback) "callback" param should be optional

From [email protected] on December 20, 2011 11:23:48

What steps will reproduce the problem? 1. Load the JS Client.
2. When loaded, call gapi.auth.init(); (no callback specified, it is supposed to be optional). What is the expected output? What do you see instead? Expected: There should be no visible output.
Actual: JS Error similar to: "GP_Tf[a] is not a function"

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=4

google api returns undefined

From raulsntos on April 20, 2012 10:45:52

I'm starting with the google api and I'm tryng to make this easy sample work:

<script> function appendResults(text) { var results = document.getElementById('results'); results.appendChild(document.createElement('P')); results.appendChild(document.createTextNode(text)); }
  function makeRequest() {
    var request = gapi.client.urlshortener.url.get({
      'shortUrl': ' http://goo.gl/fbsS' });
    request.execute(function(response) {
      appendResults(response.longUrl);
    });
  }

  function load() {
    gapi.client.setApiKey('AIzaSyD4MZ3toGaitEx3Qr7nwmNK1K3Mh6_WcVU');
    gapi.client.load('urlshortener', 'v1', makeRequest);
  }
\</script>
\<script src=" https://apis.google.com/js/client.js?onload=load"></script> \</head>

I'm using Chrome Canary 18.0.1025.162 m with the disable-web-security flag and it then it just show the text undefined. The API Key is any referer allowed. I think it should work, what's going on?

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=26

400 Bad Request Error - no idea why

From [email protected] on February 21, 2012 11:37:27

What steps will reproduce the problem? 1. Go through the oauth2 process
2. Attempt a calendar API request
3. Get 400 Bad Request error What is the expected output? What do you see instead? I want my calendar events =) Please provide any additional information below. I have base setup class that I'm using from a static server running on localhost:8000 and there things work fine.
If I try to then use this class in the same way on localhost:8082 I get the 400 error.
I believe I have my API console set up exactly the same.

I have no idea what's going on.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=15

Redirect to login has truncated email address

From [email protected] on September 28, 2012 23:38:35

What steps will reproduce the problem? If possible, provide a live demo of the issue. 1. Loggoff all users
2. Attempt to initialise the ouath flow with immediate:false and user_id:[email protected]
3. A login window pops up What is the expected output? What do you see instead? The login window has a prefilled email address of "rs". It should be "[email protected]" What version of the product are you using? On what operating system? Please provide any additional information below.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=50

No call from gapi.auth.authorize

From [email protected] on February 04, 2012 17:28:29

gapi.auth.authorize within checkAuth() does not direct to handleAuthResult
(this is taken from google code found in the authentication tab)

function handleClientLoad() {
gapi.client.setApiKey(apiKey);
gapi.auth.init(checkAuth);
}

function checkAuth() {
alert("hi");
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
}

function handleAuthResult(authResult) {
alert(authResult);
var authorizeButton = document.getElementById('authorizeAccountButton');
if (authResult) {
authorizeButton.style.visibility = 'hidden';
makeApiCall();
} else {
authorizeButton.style.visibility = '';
authorizeButton.onclick = handleAuthClick;
}
}

function handleAuthClick(event) {
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
return false;
}

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=9

Error Callback

From [email protected] on April 27, 2012 07:09:14

Hey everyone, nice work on this library. I've found it useful.

It'd be nice to have s callback if the user authorization fails. I'm trying to alert the user if we can't reach Google servers. I set a timeout before the call to gapi.auth.authorize and clear it within the success callback, but if the user takes too long to authorize then the error callback still fires. It would be nice if gapi.auth.authorize took a success callback and error callback.

Thanks

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=27

This library is not linked from the Google Oauth2 site

From [email protected] on February 22, 2012 15:45:05

What steps will reproduce the problem? 1. Go to https://code.google.com/apis/accounts/docs/OAuth2.html#libraries 2. Look for a javascript library for Oauth2. What is the expected output? What do you see instead? I would want to see this library, but instead I only saw the "OAuth 2.0 Library for Google Web Toolkit" which is not as useful for a non-GWT javascript application.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=16

Unable to post message to null. Recipient has origin null.

From J.Jolam on December 02, 2011 05:37:02

when running the sample in Chrome(15.0.874.121):

<script src=" https://apis.google.com/js/client.js"></script> <script> function appendResults(text) { var results = document.getElementById('results'); results.appendChild(document.createElement('P')); results.appendChild(document.createTextNode(text)); }
  function makeRequest() {
    var request = gapi.client.urlshortener.url.get({
      'shortUrl': ' http://goo.gl/fbsS' });
    request.execute(function(response) {
      appendResults(response.longUrl);
    });
  }

  function load() {
    gapi.client.setApiKey('YOUR API KEY');
    gapi.client.load('urlshortener', 'v1', makeRequest);
  }
\</script>

I got the error:
Unable to post message to null. Recipient has origin null.

but everything's fine in Opera

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=1

Get user id only...

From [email protected] on July 16, 2012 08:19:13

I would like to request a function in the api, that could get me only the user id of the currently signed-in user.

I have no use for the remaining user info; my app is being used to offer services to users authenticated through Google accounts, and I explicitly do not want to know, or be able to store, details about the user in my application, unless I have no other choice.

Do you think this would be feasible?

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=40

On July 2, 2012 it will stop working

From [email protected] on May 01, 2012 09:11:25

We are using the Google Contacts API 2.0 using the language Javascript. This morning some of our customers have reported the following error in the authentication screen from google:

This website is using an older Google authentication API that is no longer supported. On July 2, 2012 it will stop working. We recommend that you continue the process only if you trust the following destination:

Does anyone know if there is a newer Javascript api that we should be using?

Is Google abandoning support of Javascript for the Contacts api? I do see that there is a Google Contacts api 3.o. However, Javascript is not yet supported for that api.

thanks,

Scott

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=29

error while trying to retrieve google calendars

From [email protected] on May 06, 2012 03:51:04

The problem is related to an application available at http://www.blackdog-project.org/g7/index.html .
This application use oauth to authenticate a google user.
It provide tools for google calendar.
It requires to retrieve the calendars of the connected user. What steps will reproduce the problem? 1. simply go to the page http://www.blackdog-project.org/g7/index.html and authenticate / authorize the application to access google calendar data. Then, a message box should indicate that an error occurs when accessing the calendar data. What is the expected output? What do you see instead? Some days ago, it works fine and the calendars data were retrieved. Since 1 or 2 days, the result of the request (cf : g7model.js line 623) :

                         var request = gapi.client.calendar.calendarList.list({ 'userId': 'me' });
                         request.execute(function(calendars)
                                         { ...

return a "calendars" object that looks like :

calendars : {
"code": 404,
"message": "Not Found",
"data": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"error": {
"code": 404,
"message": "Not Found",
"data": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
]
}
} What version of the product are you using? On what operating system? the javascript client is added by the script tag :

    \<script src=" https://apis.google.com/js/client.js?onload=gapiLoadFinished"></script> This problem appears on differents OS (Mac OsX 10.6.8 and windows 7) and with differents browsers (chrome 18, opera 11.62, etc...) Please provide any additional information below. I try to generate a new browser API key (see https://code.google.com/apis/console/#project:81606904420:access ) but it did not fix the problem.

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=34

Patch for /samples/authSample.html

From jamal.larabi on March 10, 2012 02:33:52

Authorize <script type="text/javascript"> // Enter a client ID for a web application from the Google Developer Console. // The provided clientId will only work if the sample is run directly from // https://google-api-javascript-client.googlecode.com/hg/samples/authSample.html // In your Developer Console project, add a JavaScript origin that corresponds to the domain // where you will be running the script. var clientId = '837050751313';
  // Enter the API key from the Google Develoepr Console - to handle any unauthenticated
  // requests in the code.
  // The provided key works for this sample only when run from
  // https://google-api-javascript-client.googlecode.com/hg/samples/authSample.html // To use in your own application, replace this API key with your own.
  var apiKey = 'AIzaSyAdjHPT5Pb7Nu56WJ_nlrMGOAgUAtKjiPM';

  // To enter one or more authentication scopes, refer to the documentation for the API.
  var scopes = ' https://www.googleapis.com/auth/plus.me'; // Use a button to handle authentication the first time.
  function handleClientLoad() {
    gapi.client.setApiKey(apiKey);
    window.setTimeout(checkAuth,1);
  }

  function checkAuth() {
    gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);
  }


  function handleAuthResult(authResult) {
    var authorizeButton = document.getElementById('authorize-button');
    if (authResult) {
      authorizeButton.style.visibility = 'hidden';
      makeApiCall();
    } else {
      authorizeButton.style.visibility = '';
      authorizeButton.onclick = handleAuthClick;
    }
  }

  function handleAuthClick(event) {
    gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
    return false;
  }

  // Load the API and make an API call.  Display the results on the screen.
  function makeApiCall() {
    gapi.client.load('plus', 'v1', function() {
      var request = gapi.client.plus.people.get({
        'userId': 'me'
      });
      request.execute(function(resp) {
        var heading = document.createElement('h4');
        var image = document.createElement('img');
        image.src = resp.image.url;
        heading.appendChild(image);
        heading.appendChild(document.createTextNode(resp.displayName));

        document.getElementById('content').appendChild(heading);
      });
    });
  }
\</script>
\<script src=" https://apis.google.com/js/client.js?onload=handleClientLoad"></script> \<div id="content"></div>
\<p>Retrieves your profile name using the Google Plus API.</p>

Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.