'Google Drive Sdk can not set expiration time permissions
I would like to change the permissions of a Google Drive file with the PHP api client. Now my problem is that it doesn't set the expiration time. The user permission is successful.
The documentation says that I need to pass the date RFC3339 formatted but I'm doing that. What's wrong with this code?
$service = new Google_Service_Drive($client);
$permission = new Google_Service_Drive_Permission();
$permission->setRole('reader');
$permission->setType('user');
$permission->setEmailAddress('[email protected]');
$permission->setExpirationTime(date(DateTime::RFC3339, time() + 86400));
$createPermissions = $service->permissions->create(
$uploadedFileId,
$permission
);
I hope someone can help me :)
Thanks!
Solution 1:[1]
- expirationDate works in Patch or Update
- this feature has never been available in the free Google accounts and was only added relatively recently to the paid G Suite accounts
and you can check on this link : https://support.google.com/docs/thread/48687182/cannot-ste-up-temporary-access-to-shared-file-as-there-is-no-such-a-function?hl=en
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
