6 messages in com.googlegroups.google-visualization-apiRe: google spreadsheet access denied ...
FromSent OnAttachments
quarkLore19 Mar 2008 23:17 
VizGuy (Google)20 Mar 2008 03:10 
Prateek Agarwal20 Mar 2008 04:08 
minti20 Mar 2008 12:47 
JR20 Mar 2008 13:21 
VizGuy (Google)23 Mar 2008 00:17 
Subject:Re: google spreadsheet access denied error
From:VizGuy (Google) (viz@google.com)
Date:03/20/2008 03:10:20 AM
List:com.googlegroups.google-visualization-api

Short answer: Use this URL;
http://spreadsheets.google.com/tq?key=pkv_7X5t9HXVu4ZxZ-znSEA&pub=1

Long Answer: Spreadsheets have 2 permission levels: Live data and published data. Live data permissions are controlled by the permissions in the share tab, you can invite others to view or edit. Published mode allows access to anyone. You can think of a published spreadsheet a public copy of the live spreadsheet, where every time you publish it, the live data is copied to the published data.

If a gadget references the live data, the current user needs to have permissions to access the live data. If the gadget access the published data, the sheet (or entire spreadsheet) must be published.

To access the published data of a spreadsheet, append to the url the parameter pub=1. When you publish a gadget, you can see that this parameter is appended to the data source url.

On Mar 20, 8:17 am, quarkLore <agar@gmail.com> wrote:

I have created a google spreadsheet and use google visualization API to access the data and pick up a single row and display it. It works fine when my browser is logged google account but when it is not then it gives an access denied error.

I have published the spreadsheet and made it viewable by all. I can view the spreadsheet without logging in gmail
account:http://spreadsheets.google.com/pub?key=pkv_7X5t9HXVu4ZxZ-znSEA

Following is the code:

--------------------------------

<table bgcolor="black"> <tbody><tr> <td><span style="color: rgb(0, 255, 0);">root@matrix:>

<div id="quote"> </div> <script src="http://www.google.com/jsapi" type="text/javascript"></ script> <script type="text/javascript"> google.load("visualization", "1"); function initialize() { var query = new google.visualization.Query("http:// spreadsheets.google.com/tq?key=pkv_7X5t9HXVu4ZxZ-znSEA&gid=0"); query.send(handleQueryResponse); // Send the query with a callback function } google.setOnLoadCallback(initialize); // Set callback to run when API is loaded

// Query response handler function. function handleQueryResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; }

var data = response.getDataTable(); var html = []; var rows = data.getNumberOfRows(); var index = parseInt ("" + Math.random() * rows + "" ); html.push (data.getFormattedValue (index,0)); document.getElementById('quote').innerHTML = html.join('');

}

</script>

</span><img width="20" src="http://prateek.mac.googlepages.com/ blinking_cursor2.gif" height="16"/> </td> </tr>