<?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); ?>
This list of GET files does not work.
How can I get a list of files? mimetype: audio / mpeg and fields get a header and webcontentlink.
source share