Does anyone know which configurations should be done to grant Google service account an access to a Team Drive which is already created?
The idea is to use a service
Here are the steps to grant access based on the documentation from the comment in addition to the steps in the question.
These steps require an account with Services and Apps admin role.
Assuming the authentication part is set up properly, here is a simple code which gets service account's Team Drives:
var teamDriveList = service.Teamdrives.List();
teamDriveList.Fields = "teamDrives(kind, id, name)";
var teamDrives = teamDriveList.Execute().TeamDrives;
if (teamDrives != null && teamDrives.Count > 0)
{
foreach (var drive in teamDrives)
{
Console.WriteLine("{0} ({1})", drive.Name, drive.Id);
}
}
More on the Fields
parameter syntax here