I am trying to get the contents of a Google Drive table file through node.js. I use google-api-nodejs-client to get access_token and node-google-drive to get file_id .
"https://docs.google.com/feeds/download/spreadsheets/Export?key="+file_id+"&exportFormat=csv&gid=0"
When I logged in to Google Drive, and I go to this URL above, it loads the table in CSV format. When I try to go to this URL incognito, it shows the login page, which is the same page that I get in the body of my request in node.js.
request({ "method":"get", "url": "https://docs.google.com/feeds/download/spreadsheets/Export", "qs":{ "key": key, "exportFormat": "csv", "gid": 0 }, "headers":{ "Authorization": "Bearer " + token } }, function(err, response, body){ console.log(response); });
I tried to send the Authorization header, but I still get the HTML response. Contains Sorry, the file you have requested does not exist.
source share