I am attempting to use the new Application Data folder in the Drive SDK, but rather than creating a new file as the sample code shows, I wish to create a copy of a template file which the user selects. My template files are Google-editable spreadsheets held within a specific Drive account and are world-readable, with their IDs configured in my application.
I first tried the copy by specifying appdata
as a parent ID in the body of the copy request, as follows
{
"title": "New file",
"parents":
[
{
"id": "appdata"
}
]
}
this produced a 403 error with the text
Only folders or files with content stored in Drive are allowed within the appdata folder
So I tried adding root
as a second parent in the parents
array, as follows
{
"title": "New file",
"parents":
[
{
"id": "appdata"
},
{
"id": "root"
}
]
}
This fails again with a 403, but a slightly different error
Method not supported for appdata contents
I have also tried updating the parents
property of the new file after creation, and by inserting a new value into the parents entity of the newly-created file, both of which yield the same 'Method not supported' error.
So my question is, is it possible to create a copy of an existing field held in Drive, within a user's appdata folder? The fact that this consistently fails suggests not and that I may have to use the user's normal storage, but I would like to use the appdata folder if possible to separate my app's content from their general Drive files.