我想完成以下任务:
我所拥有的:
我的问题/卡住的地方
我的问题:有人问我可以调用什么方法才能查询/渲染G Drive文档吗?
谢谢!
这是我到目前为止的内容:
/**
* Initializes an G Drive API V4 service object.
*
* @return An authorized G Drive API V4 service object.
*/
public function initializeGoogleDrive()
{
// Use the developers console and download your service account
// credentials in JSON format. Place them in this directory or
// change the key file location if necessary.
$KEY_FILE_LOCATION = APPPATH. '~path/service-account-credentials.json'; // NOTE: APPPATH is my root folder constant
// Create and configure a new client object.
$client = new Google_Client();
$client->setApplicationName("My G Drive App");
$client->setAuthConfig($KEY_FILE_LOCATION);
$client->setScopes(['https://www.googleapis.com/auth/drive']);
$drivefile = new Google_Service_Drive_DriveFile($client);
return $drivefile;
}
public function getDriveFile(){
// Get Drive doc/sheet by ID
// Render Drive doc/sheet
}