This repository contains the example code for google servces api of google forms, google sheets, google drive and youtube using a google service api with service account. service account allows us to access google api with no repetative oauth verification. it is best for backend which needs to use google api.
to see the live example visit: https://robotics.wrc.edu.np
you will need service account credentials as a json file and a folder id to store all data,
first create a service account of your google account
- go to https://console.cloud.google.com/ and create project
- goto crediantials section and create service account, you will get service account email address
- do as it says
- download credentials.json form it
- not get back and go to OAuth consent screen
- fill the form
- under scope section, add https://www.googleapis.com/auth/drive to scope manually
- specify users who can access to the app
then enable the api by following:
- goto library section
- enable forms, sheets, drive api
make neccessary folders in drive
- create a new folder in drive 'datas' lets say
- share a folder with your service account mail
- get a folder id, click on copy folder-sharing link, there you can find a folder id
- implement a folder id in code
read the official project documents at;
- https://docs.google.com/document/d/1An5IxVYPGuZ3EnQVkvWWrwB_2N1DP-ZkxBRla-6vS9k/edit?usp=sharing
- https://docs.google.com/document/d/15kduoQwEFnPjY2m9nJ5oX9FrJniCWXIdCeYNNzaVBFw/edit?usp=sharing
Base form id: in order to make a form replication possible a base form is needed from which a copy is made , this form is there for yearly recurring events like robo-rookies, committee form, member intake.