-
Open Google Cloud Console and enable Sheet Api for Your Project.
-
Now Go to APIs & Service Section and Select Credentials.
-
Now Click on "Create credentials" button and select Service account name your service account,select any role in the project option. after that Click on Done.
-
Now You are redirected back to Credentials section.Now select your service account from the Service account Section. Then Scroll Down and click on Add Key and select create Key. Now just Click Create.
Rename that Downloaded Json File to "credentials.json" and Copy it to the root of Your project.