Accessing Google Sheets API from Google Sites using 'embed': "Not a valid origin for the client" Error

Viewed 209

I am trying to access a Google sheet using Google Sheets API. When I tried it locally, I was able to do it. When I tried the same from Google Sites by embedding the code, it gives me the following error.

{
  "error": "idpiframe_initialization_failed",
  "details": "Not a valid origin for the client: https://<dynamic-number>-atari-embeds.googleusercontent.com has not been whitelisted for client ID <client_id>. Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."
}

As you can see from the error message, which I have edited to hide information, the origin of the embed is dynamic. So I can't update the whitelist on developer console.

Is there a way to solve this somehow? Thanks in advance

1 Answers

Do you have started your server? If you are using python3 try this command on same directory where you have placed your index.html file.

python3 -m http.server 8000

For python2

python -m SimpleHTTPServer 8000

Then directly type http://localhost:8000/index.html No need to use LiveServer extention if you are using vscode.

Related