Access the Owner's Resources

Take a look at how to access the user resources using the generated access token.

We'll cover the following

Let's look at a React application that uses the Google Drive API. We'll send the access token retrieved in the previous lesson with the API requests to validate them.

Application workflow

This is a simple one-page application. Let's look at the application workflow from the user's perspective:

  • When the application starts, we see the home page of the application. It contains media fetched from our Google Drive account.

  • Clicking the thumbnail of any media file opens the file in a new tab via Google Drive.

  • We can also download the media files by clicking the download button associated with each of them.

Note: If there are multiple accounts logged in to the browser where the application is being used and the media file doesn't have view access for everyone, the download button will generate an error.

The widget below contains the code for our application. Click the "Run" button to see the app in action.

Get hands-on with 1200+ tech skills courses.