Search code examples
google-sheetsgoogle-sheets-apitabletop.js

Tabletop.js receiving 500 "internal error" when trying to retrieve JSON from Google Sheets API


We have been using Tabletop for a couple of projects as a simple way of accessing small amounts of data from Google Sheets.

Here is the example code from the Tabletop.js Github ReadMe:

function init() {
  Tabletop.init( { key: 'https://docs.google.com/spreadsheets/d/0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE/pubhtml',
    callback: function(data, tabletop) { 
      console.log(data)
    },
    simpleSheet: true } )
}
window.addEventListener('DOMContentLoaded', init)

Here is my example data source: https://docs.google.com/spreadsheets/d/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/pubhtml

But when I try to execute this test code: https://jsfiddle.net/BaronGrivet/oqnx2sjc/

<div id="data">
<strong>Data should appear here: </strong>
</div>

function init() {
Tabletop.init( { 
  key: 'https://docs.google.com/spreadsheets/d/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/pubhtml',
  callback: function(data, tabletop) { 
    console.log(data)
    document.getElementById('data').innerHTML += data
  },
  simpleSheet: true } )
}
init()

The following error appears in Console:

Failed to load resource: the server responded with a status of 500 () https://spreadsheets.google.com/feeds/worksheets/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/public/basic?alt=json

And loading https://spreadsheets.google.com/feeds/worksheets/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/public/basic?alt=json brings up "Internal Error"

I realise this means there is an error at Google's side - but I don't know if this is an error that is going to get fixed, or a permanent change in services that either needs a change in Tabletop, or has stopped the option to access JSON altogether.

Has anyone else come across this issue & found a solution?


Solution

  • Best to follow Google's Issue Track at https://issuetracker.google.com/issues/131613284