I'm building an application where new users (who are external to my Google Workspace domain) need a personal copy of a single Google Docs file (a template I've created). The file is shared as "anyone with link can view".
Here’s what I’ve tried:
Using drive.file scope with a service that calls the Drive API files().copy() method on behalf of the user.
Using drive scope works perfectly.
With drive.file, I consistently get a 404 "File not found" error when attempting to copy:
<HttpError 404 when requesting https://www.googleapis.com/drive/v3/files/TEMPLATE_ID/copy?alt=json returned "File not found: TEMPLATE_ID.">
Constraints & Requirements:
The template file is already shared as anyone with the link can view.
The resulting copy must be owned by the user, not the organization.
The user should not have to click a link to create the copy — this must be fully backend-initiated.
Google’s review team says drive.file should support this functionality. I have yet to make this work. I believe they mean that it is possible using the file picker API, but I want to fully automate it without user interaction.
Problem:
drive.file fails with 404.
drive works but requires a broader scope than what google thinks I need.
This suggests either:
I'm misunderstanding the limitations of drive.file, or
I'm not explaining the scenario clearly enough to Google.
Question:
Is it possible to programmatically copy a Google Docs file owned by an external organization or publicly viewable into a user’s Drive using only the drive.file scope without any user interaction?
If yes, what is the correct approach or API method or have you found a workaround?
If no, what is the official limitation that prevents this, so I can clarify my justification to Google?