I'm sorry, I didn't phrase my first response in the best way. It is fine
and correct to use the Query, that works fine. However the new Sheets won't
process your query. If you do not care about that, then you are doing
everything correct, save for your URL. You should be able to simply go to
the spreadsheet and copy the URL that shows up and it should work. If it
does not, please make another public spreadsheet so that we may experiment
and investigate.

- Sergey


On Tue, Apr 22, 2014 at 6:41 PM, Jason Collins <[email protected]>wrote:

> Thanks for the quick response Sergey.
>
> At the end of the day, I'm working with a V2 spreadsheet and am looking
> for the simplest way to display a range of data in a chart via a JavaScript
> library.
>
> I'm not really interested in the query capability; the doc I mentioned
> just suggested that was the way to go (there are a lot of different
> techniques, and it's difficult to discern which is the most
> current/appropriate).
>
> Given that I simply want to chart some data using the JavaScript lib from
> a V2 spreadsheet, can you point me to the most straightforward/appropriate
> approach?
>
> j
>
>
> On Tuesday, April 22, 2014 10:00:11 AM UTC-6, Sergey wrote:
>
>> 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.
>

-- 
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