rufo
rufo

Reputation: 5577

Google Drive using .NET API exportLinks empty

Similar to this question Getting public URL to file in Google Drive using .NET API.

using the Google.APIs.Drive.v2 API I am able to list the files DriveService.Files.List(). That returns a collection of Files.

The items have a property exportLinks, however that property is empty for all my files.

Please advise. Thanks.

Note: the folders where the files are in, are shared using Visible with Link.

Update: adding one of the resulting entries per Claudio's request:

   {
  "kind": "drive#file",
    "id": "0B3huP1kT5Jg7ckIwM1JFODhqQnM",
    "etag": "\"-tJAWr_lbRQU2o8gZ0X7BCBIlVk/MTM0MTA3MDYwODUxOQ\"",
    "selfLink": "https://www.googleapis.com/drive/v2/files/0B3huP1kT5Jg7ckIwM1JFODhqQnM",
    "alternateLink": "https://docs.google.com/file/d/0B3huP1kT5Jg7ckIwM1JFODhqQnM/edit",
    "thumbnailLink": "https://lh4.googleusercontent.com/DLv5EK327dWfKyE4OHVvqmtPNAJBh564NHWoMo_xNzjdsG9cyYgYPpca3K5VdmHfqQ=s220",
    "permissionsLink": "https://www.googleapis.com/drive/v2/files/0B3huP1kT5Jg7ckIwM1JFODhqQnM/permissions",
    "title": "WILDCHIL-BLAVEC-FULL-001.png",
    "mimeType": "image/png",
    "labels": {
     "starred": false,
     "hidden": false,
     "trashed": false,
     "restricted": false,
     "viewed": false
    },
    "createdDate": "2012-06-30T15:36:48.519Z",
    "modifiedDate": "2012-06-30T15:36:48.519Z",
    "modifiedByMeDate": "2012-06-30T15:36:46.095Z",
    "parents": [
     {
      "kind": "drive#parentReference",
      "id": "0B3huP1kT5Jg7MjNfMHZLcEdVbHM",
      "selfLink": "https://www.googleapis.com/drive/v2/files/0B3huP1kT5Jg7ckIwM1JFODhqQnM/parents/0B3huP1kT5Jg7MjNfMHZLcEdVbHM",
      "parentLink": "https://www.googleapis.com/drive/v2/files/0B3huP1kT5Jg7MjNfMHZLcEdVbHM",
      "isRoot": false
     }
    ],
    "downloadUrl": "https://doc-10-94-docs.googleusercontent.com/docs/securesc/aarkh960uprlp23t4c9u2f081smlqd2o/noa9bibpnrmajuo2632hl6ocidpf1q0j/1342476000000/03524686860055462013/03524686860055462013/0B3huP1kT5Jg7ckIwM1JFODhqQnM?h=16653014193614665626&e=download&gd=true",
    "userPermission": {
     "kind": "drive#permission",
     "etag": "\"-tJAWr_lbRQU2o8gZ0X7BCBIlVk/9STkNeCmz61YXorH3hoJimnEgfM\"",
     "id": "current",
     "role": "owner",
     "type": "user"
    },
    "originalFilename": "WILDCHIL-BLAVEC-FULL-001.png",
    "fileExtension": "png",
    "md5Checksum": "ebfa9523688cc5e0aee4cce74c288819",
    "fileSize": "701686",
    "quotaBytesUsed": "701686",
    "ownerNames": [
     "Swcatalog-canada"
    ],
    "lastModifyingUserName": "Swcatalog-canada",
    "editable": true,
    "writersCanShare": true
   },

Upvotes: 2

Views: 1238

Answers (2)

Ray Hulha
Ray Hulha

Reputation: 11221

If you encounter missing exportLinks on Google Docs double check your permissions scope.

Upvotes: 0

Claudio Cherubino
Claudio Cherubino

Reputation: 15024

Not all file formats support exportLinks and png is one of them. To know all possible import/export combinations, request the About feed and check the importFormats and exportFormats fields:

https://developers.google.com/drive/v2/reference/about#resource

Upvotes: 1

Related Questions