Skip to content

Used Google API to use the drive functionality for upload download and delete files using it as cloud storage

Notifications You must be signed in to change notification settings

chinma-yyy/Google-drive-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Drive API

Tested and used the Google API for uploading and downloading the files from Googledrive using Oauth.

Explanation about the API

  1. So in google cloud console, You must first enable the API service you want to use.
  2. After enabling the API in API and Services , create your credentials with callback url and all the scopes you may need for your project.
  3. Google will provide you Client ID and Client Secret for Oauth and API key for public APIs.
  4. Now using the googleapis npm library we can create an Oauth client and by setting the refresh token we will make it a client for which we generated the access and refresh token.
  5. Google does not need accessToken to validate a user but the refresh token and idk why?
  6. Now you can also get the accessToken by the getAccessToken() method on the client.
  7. Your client is now generated do the further task as you need.

**This Explanation is totally for my understanding! Thank you!! **

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

CLIENT_ID

CLIENT_SECRET

And optional

MONGODB_URL

Because the tokens do not change on the requests!!

🔗 Links

twitter

About

Used Google API to use the drive functionality for upload download and delete files using it as cloud storage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published