1

I cannot access some of my spreadsheets using Google API. They do not show up in the spreadsheet API listing. They do show up in Drive API listing, but they only have two MIME types : pdf and excel. I don't know how to download them as CSV.

Why do these happen?

lindenrovio
  • 357
  • 3
  • 13
  • Can you review https://developers.google.com/drive/integrate-open and https://developers.google.com/drive/about-sdk#create_and_open_files_directly_from_the_drive_ui, and tell us what part you're having difficulty with? – Robert Harvey Dec 27 '13 at 22:26
  • @RobertHarvey, hi thanks for your reply. the part I have problem with is the spreadsheet section, which says that it has three export format: MS excel, openoffice, and PDF. What I want is CSV format, and here is a post shows how to export CSV using a hack: http://stackoverflow.com/questions/11619805/using-the-google-drive-api-to-download-a-spreadsheet-in-csv-format. However, this hack seems to not work for any sheets in my "Shared with me" folder. With further investigation, I found that file.getExportLinks() returns 3 links for general files (xlsx, ods, pdf) but only 2 for files in my "Shared – lindenrovio Dec 30 '13 at 15:02
  • @RobertHarvey (continue) with me" folder (xlsx, pdf). Maybe the CSV hack get its data from the ods export link. So now I'm trying to download spreadsheet using the spreadsheet API instead of the drive API, that's why I tried to get a Spreadsheet object from the File object (got from the Drive API). I tried to use spreadsheet API to list the files, but in that case it seems that files in the "Shared with me" folder don't even show up in the listing altogether. That's why I want to use the Drive API to list the files, they at least show up. Thanks a lot! I know it's a pretty messy situation. – lindenrovio Dec 30 '13 at 15:05

2 Answers2

0

Here is example of fetching all spreadsheets and accesing worksheets: https://developers.google.com/google-apps/spreadsheets/#working_with_worksheets

jacek2v
  • 571
  • 4
  • 8
  • thanks for your reply. My problem is that the "List spreadsheets = feed.getEntries();" seems cannot return any files in my "Shared with me" folder, while the Drive API's "Files.List request = service.files().list();" can. However Drive API cannot export the file as CSV. So I'm hoping to use the Drive API to list the file and then use the spreadsheet API to access the file. But there seems to be no documentation showing how to get a Spreadshseet object from the File object in the Drive API. Thanks! – lindenrovio Dec 30 '13 at 15:14
  • Check this: https://spreadsheets.google.com/feeds/spreadsheets/private/full in browser. I got the contents of the "Sharet with me" folder. – jacek2v Dec 31 '13 at 13:31
  • thanks for the tip. turns out it is related to the version of Google sheet. I shifted to the new sheet which does not have API support yet. (this is put into an answer.) – lindenrovio Jan 02 '14 at 19:40
  • thanks for info about vew version of Google Spreadsheet. I have not used it yet. – jacek2v Jan 03 '14 at 19:40
0

the reason is that the new Google sheet does not have API support yet: https://drive.google.com/a/google.com/settings?id=docs#

lindenrovio
  • 357
  • 3
  • 13