Search code examples
jsonluagoogle-sheetscoronasdk

Lua can't decode google Sheet JSON?


I'm trying to decode a JSON string in Corona, using Lua. json.decode seems to work for older google sheets, but not for newer ones -- instead of a string of JSON data, I seem to get a lot of HTML and who knows what. It looks like this:

http://pastebin.com/rXVi5UBC

Am I getting a 404 webpage, or am I missing something? Is there some recent change to google sheets API that would have caused my data not to come down? I'm trying to parse a document like this by using the standard Lua json:decode() function.

S


Solution

  • I found out the reason why it wasn't working -- turns out NEW google sheets documents need to be "published" in order to be accessed via the API.

    https://support.google.com/docs/answer/37579?hl=en