How to copy a file using google drive api?

Please tell me how to copy a file from google drive to google drive using api
using a library "google/apiclient": "2.x-dev" when I run the script no errors
in the console everything is OK, too - but the file is not copied in your Google drive I don't see what I'm doing wrong? cloud.google ofKbepJB4hc.jpg

$api_conf = 'google/key.json';
 $client = new Google_Client();
$client->setAuthConfig($api_conf);
 $client->setScopes(array(Google_Service_Sheets::DRIVE, Google_Service_Sheets::SPREADSHEETS));

 $service = new Google_Service_Drive($client);

 $body = new Google_Service_Drive_DriveFile();
$body->setName('test');
$body->setMimeType("application/vnd.google-apps.spreadsheet");
 var_dump($service->files->copy("1Yp0IgFOo4qOgy-6BDuDgZXWe_eF7lu4Q7k1dV6JXtMUsfd", $body));
April 3rd 20 at 17:15
0 answer

Find more questions by tags GooglePHPAPI