Search code examples
google-apps-scriptgoogle-fusion-tables

Google app script : how to enable fusion table for use with app script?


When tring a simple select query against my FusionTable, i got this error

Access Not Configured. The API (Fusion Tables API) is not enabled for your project. Please use the Google Developers Console to update your configuration.

My question is 'how' enable fusion tables api in developer console for use with a standalone app script?

My dubt is about the projetc, because I cannot select my app script project from google drive as the project for which to enalbe the API. And even creating a new project, I end having a json file as credential but how I use it?

NOTE: I already enabled FusionTables into my project's advanced resource configuration AND I've already enable into Google developer fusionTable api manager... but here I read

This API is enabled, but you can't use it in your project until you create credentials. Click "Go to Credentials" to do this now (strongly recommended).

This is the core of the problem. Which credentials exactly must I create and how to use the newly generated credentials in my standalone Google App Script?

What the right answers to these questions?

enter image description here

enter image description here


Solution

  • You need to enable the API from the project's Developers Console link.

    1) Open your script project.
    2) Select Resources in the menu.
    3) Select Developers Console Project...
    4) Click the link that looks like projectname -api-project-5853434..
    5) After you get redirected to the console, click the hamburger menu in the top left and choose API Manager
    6) Type Fusion into search. And select the Fusion Tables Api. 7) Click the Enable button.

    This will take care of your first error.

    As for your second error:

    When you create a new project it generates a new developers console project for your script along with a set of default credentials. You can only access it from the script editor IDE, as it will not show up in console.developers.google.com view all projects page. I suspect your error is a result of tinkering with the projects dev credentials or possibly an error on Google's side generating the dev console project.
    I would migrate your script to a new Apps Script project. Enable the fusion table advances service and the API as I detailed above. This will clear up the second issue.