从Google电子表格中的其他工作表中获取JSON

时间:2017-01-14 19:43:41

标签: json url google-sheets uri google-spreadsheet-api

我已经知道我可以使用此格式的网址获取默认工作表 https://spreadsheets.google.com/feeds/list/mysheetid/od6/public/basic?alt=json

我看到当我切换到另一张表时,基本上谷歌电子表格只需在编辑时添加gid=1234

所以我做到了 https://spreadsheets.google.com/feeds/list/mysheetid/od6/public/basic?alt=json&gid=1234但我还是得到了第一张。

这样做的正确方法是什么?

情景:

特定电子表格已通过链接提供。电子表格文档中有两个工作表。

1 个答案:

答案 0 :(得分:4)

将od6替换为1表示第一张表单,2表示第二张表单,依此类推。像:

$scope.upload = function (file) {
    Upload.upload({
        url: 'api/upload-image.php', 
        method: 'POST',
        file: file,
        data: {
            'awesomeThings': $scope.awesomeThings,
            'targetPath' : '/media/'
        }
    }).then(function (resp) {
        //Success case code
        $location.path('/show/'+qid);
    }, function (resp) {
        //Error case code
    }, function (evt) {
        //progress calculation
        var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
        console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
    });
相关问题