GDataDB
GDataDB copied to clipboard
Set permissions
Use the Drive API to set permissions for documents created through GDataDB, so they can be shared with personal accounts and thus opened with the Drive web UI.
I make a method that add permission in the file
var request = _requestFactory.CreateRequest();
request.Headers.Set("Content-Type", "application/json");
var data = JsonConvert.SerializeObject(new {
role = role,
type = type,
value = email
});
request.UploadString(string.Format("https://www.googleapis.com/drive/v2/files/{0}/permissions", this._id), data);