{"id":18716,"date":"2017-09-21T12:15:01","date_gmt":"2017-09-21T09:15:01","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=18716"},"modified":"2017-09-19T11:54:05","modified_gmt":"2017-09-19T08:54:05","slug":"create-google-drive-app-php","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/","title":{"rendered":"How to create a Google Drive App in PHP"},"content":{"rendered":"<p>This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access files\/folders on behalf of your logged-in users.<span id=\"more-205\"><\/span><\/p>\n<p>One of the basic tasks here is to authenticate to google and access the drive on the user\u2019s behalf once they grant permission to your app. This method of authentication is called\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/OAuth\">OAuth<\/a>\u00a0and is very much needed for implementing the drive api.<\/p>\n<p>However, a good documentation to implement this in a backend app, especially a php app is very much lacking. The so called\u00a0<a href=\"https:\/\/developers.google.com\/drive\/v3\/web\/quickstart\/php\">quickstart for drive api<\/a>\u00a0and the web based example\u00a0<a href=\"https:\/\/developers.google.com\/api-client-library\/php\/auth\/web-app\">here<\/a>\u00a0show some example code, but what a lot of beginner programmers need is a step-by-step tutorial of how to go about doing it.<\/p>\n<h3 id=\"i-register-a-google-app-by-visiting-the-google-api-console\">I: Register a google app by visiting the\u00a0<a href=\"https:\/\/console.developers.google.com\/\">Google API console<\/a>:<\/h3>\n<p>The way the latest version (V3) of drive API works is only through OAuth. It means you cannot put a password or API key inside your code and access the drive files. You need to register your backend app and generate OAuth credentials for the app, so that it can access the drive on the user\u2019s behalf once the user grants permission to the app. So the first step is going to the\u00a0<a href=\"https:\/\/console.developers.google.com\/\">Google API console<\/a>, registering the app itself and generating OAuth credentials. The registration process is pretty straightforward, we just select \u201cCreate Project\u201d from the dropdown and give a nice name for the project such as\u00a0<code class=\"highlighter-rouge\">Drive Example App<\/code>in our case.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-18717\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps.png\" alt=\"\" width=\"800\" height=\"1207\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps.png 800w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps-199x300.png 199w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps-768x1159.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/drive_api_steps-679x1024.png 679w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<h3 id=\"ii-configure-the-credentials-and-download-the-client_idjson-file\">II: Configure the credentials and download the client_id.json file:<\/h3>\n<p>This is the credential file that validates to Google who you are (as a developer) and also your app that acts on your behalf. Download and save it as\u00a0<code class=\"highlighter-rouge\">client_id.json<\/code>\u00a0in the same directory as your app.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/configuration_steps_generic1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-18718\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/configuration_steps_generic1.png\" alt=\"\" width=\"700\" height=\"506\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/configuration_steps_generic1.png 700w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/configuration_steps_generic1-300x217.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<h3 id=\"iii-write-your-back-end-app\">III: Write your back-end app:<\/h3>\n<p>First of all, you have to add the dependency of google-api php library to your project. If you are using composer, all you need to do is add this package to the composer.json:<\/p>\n<pre class=\"brush:php\">\"require\": {\r\n  \"google\/apiclient\": \"^2.0\"\r\n}<\/pre>\n<p>If you don\u2019t use composer, you can just download the latest version of library from\u00a0<a href=\"https:\/\/github.com\/google\/google-api-php-client\">their repo<\/a>, and just\u00a0<code class=\"highlighter-rouge\">require_once<\/code>\u00a0it in your code like this:<\/p>\n<pre class=\"brush:php\">require_once '\/path\/to\/google-api-php-client\/vendor\/autoload.php';<\/pre>\n<p>You can follow this pattern for any kind of php project, be it based on Symfony, Laravel, CodeIgniter or even a pure php project. But this tutorial and code example is based on a pure php project.<\/p>\n<p>The first thing to do now is to handle the home page url (index.php).<\/p>\n<pre class=\"brush:php\">$client = new Google_Client();\r\n$client-&gt;setAuthConfig('client_id.json');\r\n$client-&gt;addScope(Google_Service_Drive::DRIVE);\r\n\r\nif (file_exists(\"credentials.json\")) {\r\n\t$access_token = (file_get_contents(\"credentials.json\"));\r\n\t$client-&gt;setAccessToken($access_token);\r\n\t\/\/Refresh the token if it's expired.\r\n\tif ($client-&gt;isAccessTokenExpired()) {\r\n\t\t$client-&gt;fetchAccessTokenWithRefreshToken($client-&gt;getRefreshToken());\r\n\t\tfile_put_contents($credentialsPath, json_encode($client-&gt;getAccessToken()));\r\n\t}\r\n\t$drive_service = new Google_Service_Drive($client);\r\n\t$files_list = $drive_service-&gt;files-&gt;listFiles(array())-&gt;getFiles(); \r\n\techo json_encode($files_list);\r\n} else {\r\n  $redirect_uri = 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/oauth2callback.php';\r\n  header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));\r\n}<\/pre>\n<p>We first check whether we have the drive access credentials for the user locally stored in a file called credentials.json (not to be confused with client_id.json we downloaded earlier which is for developer credentials). Again, we are assuming a single user scenario here. If your drive app needs to authenticate with multiple users, you\u2019ll have to store separate credentials.json for each logged-in user in the database, and access that through a session or something.<\/p>\n<p>Further, if credentials aren\u2019t found locally, we direct them to\u00a0<code class=\"highlighter-rouge\">\/oauth2callback.php<\/code>, so google will authenticate them and send us the token for accessing the drive, and after that, we will put that token into the local file, credentials.json and redirect the user back to the index.php. Finally, we call the\u00a0<code class=\"highlighter-rouge\">listFiles()<\/code>\u00a0method that displays the list of all files and folders in that user\u2019s drive. Here is the code for\u00a0<code class=\"highlighter-rouge\">oauth2callback.php<\/code>:<\/p>\n<pre class=\"brush:php\">$client = new Google_Client();\r\n$client-&gt;setAuthConfigFile('client_id.json');\r\n$client-&gt;setRedirectUri('http:\/\/' . $_SERVER['HTTP_HOST'] . '\/oauth2callback.php');\r\n$client-&gt;addScope(Google_Service_Drive::DRIVE); \/\/::DRIVE_METADATA_READONLY\r\n\r\nif (! isset($_GET['code'])) {\r\n  $auth_url = $client-&gt;createAuthUrl();\r\n  header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));\r\n} else {\r\n  $client-&gt;authenticate($_GET['code']);\r\n  $access_token = $client-&gt;getAccessToken();\r\n  file_put_contents(\"credentials.json\", json_encode($access_token));\r\n   \r\n  $redirect_uri = 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/';\r\n  header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));\r\n}<\/pre>\n<p>Once you have the credentials locally (in the form of\u00a0<code class=\"highlighter-rouge\">credentials.json<\/code>), you can just use it to access the drive API. Thus, the result of this whole exercise is that only on first page load is the user redirected to google site to authenticate themselves. Once the app has the access token (credentials.json), its no longer required, the drive can be accessed directly by the app from then on. If all goes well, you should be able to see a screen such as this when you test this example app for the first time:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/oauth_screen_generic.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-18719\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/oauth_screen_generic.png\" alt=\"\" width=\"462\" height=\"279\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/oauth_screen_generic.png 462w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/oauth_screen_generic-300x181.png 300w\" sizes=\"(max-width: 462px) 100vw, 462px\" \/><\/a><\/p>\n<p>I\u2019ll leave the more comprehensive use of this API as an exercise to the reader who wants to develop a more fully featured app out of this. Click the below link to download the source for this example implementation from the Github repo:<\/p>\n<p><a class=\"btn btn-md btn-success\" href=\"https:\/\/github.com\/prahladyeri\/php-drive-example\/\">\u00a0php_drive_example<\/a><\/p>\n<p>Note:<\/p>\n<p>If you are getting an SSL certificate error while testing this on Windows, have a look at\u00a0<a href=\"http:\/\/stackoverflow.com\/questions\/29822686\/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate\">this<\/a>.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/www.prahladyeri.com\/blog\/2017\/01\/how-to-create-google-drive-app-php.html\">How to create a Google Drive App in PHP<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">WCG partner<\/a> Prahlad Yeri at the <a href=\"http:\/\/www.prahladyeri.com\/\">Prahlad Yeri<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access files\/folders on behalf of your logged-in users. One of the basic tasks here is to authenticate to google and access the drive on the user\u2019s behalf &hellip;<\/p>\n","protected":false},"author":20,"featured_media":930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-18716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a Google Drive App in PHP - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a Google Drive App in PHP - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prahlad1981\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-21T09:15:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prahlad Yeri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/prahladyeri\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prahlad Yeri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\"},\"author\":{\"name\":\"Prahlad Yeri\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/adbf41ec03855cdb1730dd42f2725bfd\"},\"headline\":\"How to create a Google Drive App in PHP\",\"datePublished\":\"2017-09-21T09:15:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\"},\"wordCount\":764,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\",\"name\":\"How to create a Google Drive App in PHP - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"datePublished\":\"2017-09-21T09:15:01+00:00\",\"description\":\"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/php\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to create a Google Drive App in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/adbf41ec03855cdb1730dd42f2725bfd\",\"name\":\"Prahlad Yeri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70a8e7bba939c7539943aa1191374d2504d95a2a95acb04a1e44adc3b4c72fe3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70a8e7bba939c7539943aa1191374d2504d95a2a95acb04a1e44adc3b4c72fe3?s=96&d=mm&r=g\",\"caption\":\"Prahlad Yeri\"},\"description\":\"Prahlad is a freelance software developer working on web and mobile application development. He also likes to blog about programming and contribute to opensource.\",\"sameAs\":[\"http:\/\/www.prahladyeri.com\/\",\"https:\/\/www.facebook.com\/prahlad1981\",\"http:\/\/in.linkedin.com\/pub\/prahlad-yeri\/16\/a53\/243\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/prahladyeri\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/prahlad-yeri\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a Google Drive App in PHP - Web Code Geeks - 2026","description":"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/","og_locale":"en_US","og_type":"article","og_title":"How to create a Google Drive App in PHP - Web Code Geeks - 2026","og_description":"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access","og_url":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/prahlad1981","article_published_time":"2017-09-21T09:15:01+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","type":"image\/jpeg"}],"author":"Prahlad Yeri","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/prahladyeri","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Prahlad Yeri","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/"},"author":{"name":"Prahlad Yeri","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/adbf41ec03855cdb1730dd42f2725bfd"},"headline":"How to create a Google Drive App in PHP","datePublished":"2017-09-21T09:15:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/"},"wordCount":764,"commentCount":2,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/","url":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/","name":"How to create a Google Drive App in PHP - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","datePublished":"2017-09-21T09:15:01+00:00","description":"This is the second article in the drive series for web programmers that aims to explain how to use the Google Drive API in your web applications to access","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/php\/create-google-drive-app-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"PHP","item":"https:\/\/www.webcodegeeks.com\/category\/php\/"},{"@type":"ListItem","position":3,"name":"How to create a Google Drive App in PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/adbf41ec03855cdb1730dd42f2725bfd","name":"Prahlad Yeri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/70a8e7bba939c7539943aa1191374d2504d95a2a95acb04a1e44adc3b4c72fe3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70a8e7bba939c7539943aa1191374d2504d95a2a95acb04a1e44adc3b4c72fe3?s=96&d=mm&r=g","caption":"Prahlad Yeri"},"description":"Prahlad is a freelance software developer working on web and mobile application development. He also likes to blog about programming and contribute to opensource.","sameAs":["http:\/\/www.prahladyeri.com\/","https:\/\/www.facebook.com\/prahlad1981","http:\/\/in.linkedin.com\/pub\/prahlad-yeri\/16\/a53\/243\/","https:\/\/x.com\/https:\/\/twitter.com\/prahladyeri"],"url":"https:\/\/www.webcodegeeks.com\/author\/prahlad-yeri\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=18716"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18716\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/930"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=18716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=18716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=18716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}