The correct URL to access the new spreadsheets via a Query is
https://docs.google.com/spreadsheets/d/1F8s...[snip]...SDdJI/gviz/tq
Please be aware that at the moment these URLs do not properly handle
queries, so you should either use old Sheets, or implement your query on
the client-side via a DataView. There is currently an open
issue<https://code.google.com/p/google-visualization-api-issues/issues/detail?id=1476>against
this, if you would like to Star it.

- Sergey


On Tue, Apr 22, 2014 at 11:51 AM, Jason Collins <[email protected]>wrote:

> I have a spreadsheet (V2-style, "new" spreadsheets) that I have allowed
> public Can View access (will adjust once I get the simplest case working).
>
> I am attempting to grab a chunk of data via the JS Visualization library,
> but I seem to continually get a redirect.
>
> My code:
>
> function drawChart() {
>   var url = "
> https://docs.google.com/a/vendasta.com/spreadsheet/tq?range=A2:A31&key=1jsq_BdcpRQ...[snip]...qQg&gid=855264867&headers=1
> ";
>   var query = new google.visualization.Query(url);
>   query.send(handleQueryResponse);
> }
>
>
> google.load("visualization", '1', {packages:['corechart']});
> google.setOnLoadCallback(drawChart);
>
>
> This yields the following interaction:
>
> Request URL:
> https://docs.google.com/a/vendasta.com/spreadsheet/tq?range=A2:A31&key=1jsq_BdcpR
> ...[snip]...qQg&gid=855264867&headers=1&tqx=reqId%3A0
>
>
>    1. status:
>    302 Moved Temporarily
>    2. location:
>    https://docs.google.com/a/vendasta.com/spreadsheets/d/1jsq_BdcpRQ
>    ...[snip]...qQg/tq?range=A2:A31&gid=855264867&headers=1&tqx=reqId:0
>
>
> Request URL:
> https://docs.google.com/a/vendasta.com/spreadsheets/d/1jsq_BdcpRQ
> ...[snip]...qQg/tq?range=A2:A31&gid=855264867&headers=1&tqx=reqId:0
>
>
>    1. status:
>    404 Not Found
>
>
> Following the docs here:
> https://developers.google.com/chart/interactive/docs/spreadsheets
>
>
> I've tried a number of different URLs to no avail. The docs and the Code
> Playground don't seem to have any consistency over what is the correct url
> to use.
>
>
> 1. What is the correct url to access data via this mechanism?
> 2. (less important given the answer above) Why is the above interaction
> redirecting to a 404?
>
> Thanks,
> j
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to