I am using Node.js google-api client for creating file in google drive normally when i create file everything work fine , here is an example :
drive.files.create({
resource: {
name: 'Another File 5',
mimeType: 'text/plain',
},
media: {
mimeType: 'text/plain',
body: 'It\'s Another Fucking File',
}
}, function(err,result){
if(err) console.log(err)
else console.log(result)
});
Now i want create a shared "shared": true
its give me this error :
drive.files.create({
resource: {
name: 'Another File 5',
mimeType: 'text/plain',
"shared": true
},
media: {
mimeType: 'text/plain',
body: 'It\'s Another Fucking File',
}
}, function(err,result){
if(err) console.log(err)
else console.log(result)
});
Error :
{ [Error: The resource body includes fields which are not directly writable.]
code: 403,
errors:
[ { domain: 'global',
reason: 'fieldNotWritable',
message: 'The resource body includes fields which are not directly writable.' } ] }
I tried this in Google APIs Explorer and gave same error.
I am new to google Api and appreciate any help.