https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable. How do find the file id

When I use https://www.googleapis.com/upload/drive/v3/files without uploadType=resumable I receive back a JSON containing the file id. So this is ideal for creating folders.

If I want to add a file > 5MB I have to use resumable and I receive a upload URL for use with PUT.

Presently I am performing a list of the folder by specifying the file name and folder id and then pick the one with the latest date.

The documentation refers to querying the location URL but I can not find any examples to whether this returns the file id.

Can anybody explain how to get the file id easily.

Regards Conwyn

Upvotes: 0

Views: 422

Answers (1)

When you use the Google Drive API to create a file > 5M you have to use POST with uploadType=resumable. This returns a URL which you use with PUT. When the PUT completes it returns the file metadata [[:]] from which you can determine the file id ["id"].

I have suggested a documentation change to Google.

Regards Conwyn

Upvotes: 0

Related Questions