1
votes

We are using Google Drive API for uploading data to Google team drive. https://developers.google.com/apis-explorer/#p/drive/v3

Need advice on below issues.

  1. We wanted to modify CreatedTime field of document which is uploaded to custom date(past date). When we try to update this, we are getting error

"The resource body includes fields which are not directly writable "

Can you please advise if is there any way to update CreateTime to custom date(rather than date when document is getting uploaded)

  1. Same way we also wanted to update CreatedBy property, what we see that Google Drive document has owners property which hold the value of the user who has uploaded document. As we are uploading from custom code we wanted to set this to custom value. Can you please advise if this is possible as we are getting error "The resource body includes fields which are not directly writable "
1
Can't be done. You can't change history. it's worth explaining why you want to do this. You might be able to achieve the equivalent outcome using custom properties.pinoyyid

1 Answers

1
votes

Not all the files are updatable with the API. Logically speaking a create date is just that the date a file is created changing that would result in invalid data as it would not be true the date it was created was the date it was created.

There is really no way you are going to be able to fix this unless you want to create a file in an hour in which case i sugest you create a new file then and copy the data to that date. This will of course not work if you want to create a file in the past