1

我想从谷歌电子表格中获取JSON,我搜索了几个链接,但找不到确切的解决方案。
从谷歌电子表格使用JavaScript获取JSON

有人可以帮我解决方案。

https://developers.google.com/gdata/docs/json
http://www.mail-archive.com/[email protected]/msg01924.html
http://code.google.com/apis/gdata/docs/js.html
http://code.google.com/apis/spreadsheets/gadgets/
http://code.google.com/apis/documents/docs/3.0developers_guide_protocol.html#UploadingDocs

问候
阿努普·辛格

+0

什么* *明确你不确定?如果您希望人们继续为您提供帮助,您需要接受更多以前问题的答案。 –

回答

2

晚了一点,但这里的工作流程:

见适当OAuth授权答案here如果您的电子表格是私有的。

您可以通过转到Google云端硬盘并查看电子表格来找到您的电子表格密钥。在url中是字符串“key = xxxx”。 'xxxx'是您的Spreadsheet键。

然后仅仅做到以下几点:

var token = gapi.auth.getToken().access_token; 
var urlLocation = ''; //put the spreadsheet key here 
var url = 'https://spreadsheets.google.com/feeds/list/' + urlLocation + '/od6/private/full?alt=json-in-script&access_token=' + token + '&callback=?'; 

$.getJSON(url, function(data) { 
    console.log(data); 
}); 
+0

感谢您的支持,它完成了我在Google文档中找到的解决方案的开始,您必须获得设置了权限范围(https://spreadsheets.google.com/feeds)等的gapi标记。https:/ /developers.google.com/api-client-library/javascript/features/authentication –