I'm trying this way:
var oauth2Client = new OAuth2(GDRIVE_CLIENT_ID, GDRIVE_CLIENT_SECRET, GDRIVE_REDIRECT_URI);
oauth2Client.setCredentials({
access_token: some_valid_access_token
});
drive.files.insert({
auth: oauth2Client,
resource: {
mimeType: 'application/vnd.google-apps.folder',
title: 'my new folder'
}
},function(err,response){
if(err){
console.log('error at gdrive creat folder: ' + util.inspect(err));
}else{
console.log('create response: ' + util.inspect(response));
}
});
And getting an error:
You cannot upload content to files of type application/vnd.google-apps.folder
What's the correct way of doing this?