0

So I'm working with the Google-Drive-Ruby-Client API to export some data into spreadsheets. The problem is, when I'm trying to get the exportLink to download the spreadsheets into a CSV format, what I'm getting as a response in the Google API Explorer and what I'm getting when using in my application doesn't match up. Specifically, the entire exportLinks sections of the response is missing.

Has this way of downloading the spreadsheets been deprecated? Is there any other way to export spreadsheets into a CSV format? Or any other workable format (perhaps a multidimensional array?)

client = Google::APIClient.new(:application_name => APPLICATION_NAME)
client.authorization = authorize
drive_api = client.discovered_api('drive', 'v2')

result = client.execute!(
               :api_method => drive_api.files.get,
               :parameters => {:fileId => "1MBP9Q9Q-9ZgLoYnY8ExS-EcxHLESI_vcK4J91ngp6-Q"})
file = result.data
puts("Fetched #{file["title"]}")
puts("Getting downloadURL")
exportLinks = file['exportLinks']

From there, I should be able to call exportLinks['text/csv'] is my understanding, but the response does not include the exportLinks section like it does in the API Explorer.

Edit: I use the same authorization that Google uses in its quick start guide, and that all works fine, as well as other methods work fine, so I know I'm connecting to the Drive API correctly, I'm just not sure why my responses aren't matching the API Explorer.

Bill L
  • 2,576
  • 4
  • 28
  • 55
  • Please post some code so that we can answer things like *"Has this way of downloading the spreadsheets been deprecated? Is there any other way to export spreadsheets into a CSV format? Or any other workable format (perhaps a multidimensional array?)"* As of right now e have no idea how you are doing it so how could we suggest other ways? – engineersmnky Aug 25 '15 at 14:05
  • @engineersmnky updated – Bill L Aug 25 '15 at 14:51

0 Answers0