0
votes

I m sending a GET request to a published google sheets. All the tutorials show that a JSON object is returned but I receive HTML. Is it due to an update? How can I parse it into JSON?

Published sheet: https://docs.google.com/spreadsheets/d/e/2PACX-1vTLSQ-WGM8O0iCCTal0eFoAvFFIVK04UxUiCuBJLGVy89EY301-0cF5PZupIXh-sF_L9pHIw6tVtN1G/pubhtml

Expected output when you go to the link: JSON object

Obtained output: HTML

References: https://sandbox.idre.ucla.edu/sandbox/general/databasing-google-spreadsheets-to-json

https://medium.com/storyline-blog/how-to-create-a-dynamic-alexa-skill-using-google-sheets-and-storyline-9fd37f2080d8

In these, JSON is returned when a request is made whereas I receive an HTML

An example of google sheet returning JSON:

https://spreadsheets.google.com/feeds/list/SPREADSHEET_ID/od6/public/basic?alt=json

1
Which tutorial? You'd probably need to add a url query parameterTheMaster
I added them in the question now @TheMasterSumanth Somshekhar
Nope. I get a page not found error if I use the same URL templateSumanth Somshekhar
Hello @SumanthSomshekhar, could you post the complete solution as an answer?So others running into the same issue can solve it easily.Jescanellas

1 Answers

0
votes

When you publish a google sheet, you are prompted by a pop displaying a link such as

https://docs.google.com/spreadsheets/d/e/2PACX-1vTVZ3fWRSMu5nFGUc05ACV1h0-UGW49wi9lHAyJVUMp8FX3TANqy_9WNhkcd4z1mJSSN-LZyyBdS_vK/pubhtml

2PACX-1vTVZ3fWRSMu5nFGUc05ACV1h0-UGW49wi9lHAyJVUMp8FX3TANqy_9WNhkcd4z1mJSSN-LZyyBdS_vK is not the skill id

The skill ID is present in the search bar. For example the search bar has the link, https://docs.google.com/spreadsheets/d/1bm6Fjiacmuh0qRjuHoBU35AHPdF7S4R7BEIK46H0wUo/edit#gid=0

where 1bm6Fjiacmuh0qRjuHoBU35AHPdF7S4R7BEIK46H0wUo is the link.