Share a File and Audit Its Access
A 4-step recipe with Google Drive. We can help you get access.
Recipe · 4 steps
Share a File and Audit Its Access
with Google Drive
Grant a grantee access to a Drive file and verify the resulting permissions.
- Read the file's metadata to confirm it exists and is reachable by the caller before any permission is written to it.
- Snapshot the file's permissions before the change so the new grant can be compared against who already had access.
- Create the requested permission on the file, granting the supplied role to the supplied grantee.
- Re-read the file's permissions so the caller can verify the new grant is present and see the complete access list after the change.
What you'll need to have ready
- fileId: The ID of the file to share.
- granteeType: The type of grantee — one of user, group, domain, or anyone.
- role: The role to grant — one of owner, organizer, fileOrganizer, writer, commenter, or reader.
- emailAddress: The email address of the grantee. Required when granteeType is user or group; omit for domain or anyone grants.
- domain: The domain the permission applies to. Required when granteeType is domain; omit otherwise.
For your developer
Arazzo workflow google-drive:share-file-and-audit-access, 4 operations: getFile → listPermissions → createPermission → listPermissions. Specs on APIs.io.