0

So I'm trying to insert into my Fusion Table from a script located on a google scripts but from a different account and different computer. The account does not know about the Fusion Table and when it tries to run the script that needs to insert the value, it returns a "Forbidden" error

Here's my code to store an e-mail entry

function registration(tableId) {

  var email = "test";
  var sql = "INSERT INTO " + tableId + " (Email) VALUES (\'" + email + "\');";
  var query = FusionTables.Query.sql(sql);
}

It always results in a forbidden if I try to insert it from another drive account. But the weird thing is that a

SELECT * FROM tableId;

Works just fine and pulls everything from the table. What am I doing wrong?

1 Answers1

0

With that "Forbidden" error, I would suggest that you check these two things:

  1. Please make sure that you have already enabled Advanced Google Services. As noted in Fusion Tables Service,

    This is an advanced service that must be enabled before use.

  2. Secondly, please make sure that your Fusion Table is exportable. As provided by @WillemLabu in this SO post, please check the following:

    File → About this table → Edit table information → Check the "Allow download" checkbox

You may also check the given solution in Fix “403 Forbidden” Error with Google Fusion Table REST API.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22