1

I want to fetch JSON from google spreadsheet, I searched few links but cannot find the exact solution.

Can someone help me with the solution.

https://developers.google.com/gdata/docs/json
http://www.mail-archive.com/google-help-dataapi@googlegroups.com/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

Regards
Anup Singh

4

2 に答える 2

2

少し遅れますが、ワークフローは次のとおりです。

スプレッドシートが非公開の場合の適切なOAuth認証については、こちらの回答をご覧ください。

スプレッドシートのキーは、Googleドライブに移動してスプレッドシートを確認することで見つけることができます。URLには、文字列「key=xxxx」が含まれています。「xxxx」はスプレッドシートのキーです。

次に、単に次のことを行います。

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);
});
于 2013-02-08T07:14:30.397 に答える
1

https://developers.google.com/gdata/samples/spreadsheet_sample

ここに例があります。

この JSON は、「公開された」スプレッドシートでのみ機能することに注意してください。

于 2012-07-06T04:41:58.923 に答える