Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Javascript API (gapi) - problems with .load
    primarykey
    data
    text
    <p>I am trying to use the Google plus API (via googie-api-javascript) implementation like so (omitting full code):</p> <pre><code>var clientId = '7454475891XxxxxxXom4c6n.apps.googleusercontent.com'; //fake client var apiKey = '-uTH_p6NokbrXXXXXXXXXXXXX'; //Fake Key var scopes = 'https://www.googleapis.com/auth/plus.me'; 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) { if (authResult &amp;&amp; !authResult.error) { makeApiCall(); } else { //handle user-approval } } // Load the API and make an API call. Display the results on the screen. function makeApiCall() { gapi.client.load('plus', 'v1', function() { var o = gapi.client.plus; alert(o); }); } </code></pre> <p>The code works well upto the point of gapi.client.load (including the user allowing access) - this callback gets called but alert(o) will return undefined. </p> <p>Upon inspecting the HTTP request I see the .load issues a request to:</p> <pre><code>https://content.googleapis.com/discovery/v1/apis/plus/v1/rpc?fields=methods%2F*%2Fid&amp;pp=0&amp;key=-uTH_p6NokbrXXXXXXXX </code></pre> <p>This returns HTTP 400 with the following message:</p> <pre><code>{"error":{"errors":[{"domain":"usageLimits","reason":"keyInvalid","message":"Bad Request"}],"code":400,"message":"Bad Request"}} </code></pre> <p>My question is - what do I need to change to make this work? Is there some secret setting I need to enable ? Google+ is enabled in the google-developer-console under the APIs list.</p> <p>Thanks for the help, Alon</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload