
Add constantĪt the top of my program class i am going to create a couple of constants. You will need to include the 3 nuget package. Of project you create but for this example we are going to keep it simple and just use a console app. net core console application, but you can use service accounts, with libraries or with asp. 4 Create Google Drive API V3 service object.įor this i am going to create a.How to create Google Oauth2 Service account credentials. If you have any issues I have a video which you can go check out and it will walk you through creating Download the json key file and don’t forget to enable the google drive api So you will need to go to Google developer console and create a new service account. You should consider using a service account if you are going to be accessing private data that you the developer own, if you are going to be accessing data that belongs to another user then you should be using Oauth2. It’s that simple there will be no need for user interaction and a consent screen to popup. To upload to that directory on my google drive account. So I can take the service accounts email address and share with it a directory on my Google Drive account then it will have access You can pre authorize a service account granting it access to your data. Think of a service account as a dummy user. There are a lot of use cases for accessing the Google Drive API v3 with a service account. This Tutorial was completely rewritten in April, 2021
