- By Monitri Mirai
- 26, March, 2024
- Technology
- 20 Feb, 2024
Loading ...
The core functionality of Drive apps is to download and upload files in Google Drive. However, the Drive platform provides a lot more than just storage. This page describes some of that functionality and points you to resources for building it into your app.
Drive automatically indexes the content of most common file types (e.g. .html, .xml, .txt, ...) for search as soon as they are uploaded. Also, Drive uses OCR to find text in images or PDF files and automated object recognition technology to examine and index identifiable objects, people and places. For other resources such as drawings or other unique file types that are not automatically indexed by Google, apps can provide their own indexable text when they save files to Drive
Before you calling the API, you need to set it up.
Now copy and paste the below code on your local or online server.
"https://www.googleapis.com/drive/v2/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer client-id",
"cache-control: no-cache",
"orderby: folder",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Now replace client-id with your value that your are created from here in the above code. After replacing the values run the file and you will get all the drive files as shown below. You can cross check by open Google Docs. techhawa-google-all-drive-links