Note that there are some explanatory texts on larger screens.

plurals
  1. POResponse varies between FusionTables HTTP call and call with JavaScript client library (gapi)
    primarykey
    data
    text
    <p>I have a JavaScript client application. When I call the FusionTables API to retrieve some data through a SQL query using Angular's $http service (essentially XHR underneath) the data I expect is returned correctly:</p> <p>(Note config.apiKey is my Google API key, verified as correct from the cloud console)</p> <pre><code>$http({ "method": "GET", "url": "https://www.googleapis.com/fusiontables/v1/query", "params": { "sql": sql, "key": config.apiKey } }); </code></pre> <p>Now, when I use the JavaScript client library like so, I get an "Access Not Configured" error:</p> <p>(earlier...)</p> <pre><code>gapi.client.setApiKey(config.apiKey); gapi.client.load("fusiontables", "v1") </code></pre> <p>(note this has a callback which defers code execution until it has successfully loaded)</p> <pre><code>gapi.client.fusiontables.query.sql({ "sql": sql }).execute(function(data) { future.resolve(data); }); </code></pre> <p>This results in data containing:</p> <pre><code>{ "code": 403, "message": "Access Not Configured", "data": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured" } ], "error": { "code": 403, "message": "Access Not Configured", "data": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured" } ] } } </code></pre> <p>Under the hood it appears to use some kind of JSON RPC format for calling the API so perhaps there is a difference there. The documentation for accessing fusion tables through the client library seems to have disappeared in the transition to the new developers.google.com which doesn't seem to help.</p> <p>Any suggestions as to how to properly configure this or even debug it a bit would be most welcome.</p> <p>Update:</p> <p>I am using the G+ version of client.js (called client:plusone.js) because I need to render Google+ buttons. When I am logged in, I get an insufficient permission warning (even when setting the API key), so I am thinking this is a conflict between the Fusion Tables client and the Google+ client - I'm trying to find out if there is a way to specify the auth method to use but it appears not.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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