useApplicationDefaultCredentials(); $client->addScope(Google\Service\Drive::DRIVE); $service = new Google_Service_Slides($client); try { $presentation = new Google_Service_Slides_Presentation($title); //creating a presentation $presentation = $service->presentations->create($presentation); printf("Created presentation with ID: %s\n", $presentation->presentationId); return $presentation; } catch (Exception $e) { echo 'Message: ' . $e->getMessage(); } } // [END slides_create_presentation] require 'vendor/autoload.php'; createPresentation("sample presentation");