<?php
require_once './src/Google_Client.php';
require_once './src/contrib/Google_DriveService.php';
$client = new Google_Client();
$client->setApplicationName("test");
$client->setClientId('test.apps.googleusercontent.com');
$client->setClientSecret('test');
$client->setRedirectUri('http://test.com/');
$client->setScopes(array('https://www.googleapis.com/auth/drive','https://www.googleapis.com/auth/drive.readonly','https://www.googleapis.com/auth/drive.file','https://www.googleapis.com/auth/drive.metadata.readonly','https://www.googleapis.com/auth/drive.appdata','https://www.googleapis.com/auth/drive.apps.readonly'));
if(empty($_GET['code']))
{
$client->authenticate();
}
$service = new Google_DriveService($client);
$client->setAccessToken($accessToken);
$accessToken = $client->authenticate($_GET['code']);
$response = http_get("https://www.googleapis.com/drive/v2/files?q=mimeType+%3D+'audio%2Fmpeg'&fields=items(title%2CwebContentLink)&key=".$accessToken);
print_r($response);
?>
此 GET 文件列表不起作用。
我怎样才能得到这样的文件列表?mimetype :音频/mpeg 和字段获取标题和 webcontentlink。