capabilities.work

Provision a Folder and Seed a File

A 3-step recipe with Google Drive. We can help you get access.

Recipe · 3 steps

Provision a Folder and Seed a File

Create a Drive folder and seed it with an initial file.

  1. Create the folder by creating a file with the Drive folder MIME type. The returned id is the handle every child file references via parents.
  2. Create the initial file inside the folder created by the previous step by pointing the parents array at that folder's id.
  3. Read the seeded file back, explicitly selecting the parents field, to confirm it was filed under the newly created folder rather than at the Drive root.
What you'll need to have ready
  • folderName: The name of the folder to create (e.g. "Acme Integration").
  • parentFolderId: Optional ID of an existing folder to nest the new folder under. Omit to create the folder at the root of the user's Drive.
  • fileName: The name of the first file to create inside the new folder.
  • fileMimeType: The MIME type of the seeded file (e.g. application/vnd.google-apps.document).
For your developer

Arazzo workflow google-drive:provision-folder-and-seed-file, 3 operations: createFile → createFile → getFile. Specs on APIs.io.