I want to share a file on multiple email address using google drive api. I have enabled the google drive api and set the credentials over there. I am able to share a file on single email address with below code but i want to share a file on multiple Email address so please tell me how to fix this issue.
$client = getClient();
$service = new Google_Service_Drive($client);
$fileId = '1cFHdHkVw-9UzBq2N1v4Yaf0UPzBBUuAW';
$userPermission = new Google_Service_Drive_Permission(array(
'type' => 'group',
'role' => 'writer',
'emailAddress' => 'navneet4561@gmail.com'
));
$request = $service->permissions->create(
$fileId, $userPermission, array('fields' => 'id'));
if($request instanceof Google_Service_Exception)
{
// Handle error
printf($request);
}
else
{
printf("Permission ID: %s
", $request->id);
}