Quickstarts explain how to set up and run an app that calls a Google Workspace API.
Google Workspace quickstarts use the API client libraries to handle some details of the authentication and authorization flow. We recommend that you use the client libraries for your own apps. Before you can run the sample app, each quickstart requires that you turn on authentication and authorization. If you're unfamiliar with authentication and authorization for Google Workspace APIs, read the Authentication and authorization overview.
Create a Python command-line application that makes requests to the Google Sheets API.
Objectives
- Set up your environment.
- Install the client library.
- Set up the sample.
- Run the sample.
Prerequisites
To run this quickstart, you need the following prerequisites:
- Python 2.6 or greater
- The pip package management tool
- A Google Cloud project.
- A Google Account.
Set up your environment
To complete this quickstart, set up your environment.
Opene console.clude.google
https://console.cloud.google.com/
1) Create new Project✨🎉Congratulation you have successfully created new project
Enable the API
Before using Google APIs, you need to enable them in a Google Cloud project. You can enable one or more APIs in a single Google Cloud project.
In the Google Cloud console, enable the Google Sheets API.
Authorize credentials for a desktop application
To authenticate as an end user and access user data in your app, you need to create one or more OAuth 2.0 Client IDs. A client ID is used to identify a single app to Google's OAuth servers. If your app runs on multiple platforms, you must create a separate client ID for each platform.
- In the Google Cloud console, go to Menu > APIs & Services > Credentials.
- Click Create Credentials > Create services account
- Create role as editer
- shere sheet file to given gmail account
- Now go to credentials and create new Key for API
- Save the downloaded JSON file as
credentials.json or key.jso
n
, and move the file to your working directory.
Now Open Your new code editor and connect python code with API
Install the Google client library
Install the Google client library for Python:
Comments
Post a Comment