The Google Docs API allows you to create, read, and update Google Docs programmatically, enabling a wide range of automations and integrations with other apps and services. With Pipedream, you can harness this API to craft custom serverless workflows that trigger on various events, like form submissions, emails, or scheduled times, and perform actions like updating a document, extracting content, or even generating templated reports.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
google_docs: {
type: "app",
app: "google_docs",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://www.googleapis.com/drive/v3/about?fields=user`,
headers: {
Authorization: `Bearer ${this.google_docs.$auth.oauth_access_token}`,
},
})
},
})
Content Management Automation: Automatically update a Google Docs content repository when a new blog post is submitted through a CMS like WordPress. Pipedream can watch for new posts and update a master document that tracks all published content.
Contract Generation from CRM Events: Generate personalized contracts in Google Docs when a new deal is marked as won in a CRM platform like Salesforce. With Pipedream, the workflow can populate a contract template with details from the CRM and share the document with relevant parties.
Meeting Notes Distribution: After a meeting, distribute notes or action items captured in Google Docs to all attendees using their email addresses. Pipedream can extract the contents of a document and send customized emails through a service like SendGrid, ensuring everyone stays in the loop.
Emit new event when a new document is created in Google Docs. See the documentation
Emit new event when a document is created or updated in Google Docs. See the documentation
Appends an image to the end of a document. See the documentation
Create a new document from plain text. See the docs
Get the contents of the latest version of a document. See the documentation
Google Docs uses OAuth authentication. When you connect your Google Docs account, Pipedream will open a popup window where you can sign into Google Docs and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Docs API.
Pipedream requests the following authorization scopes when you connect your account:
https://www.googleapis.com/auth/drive
GET
https://accounts.google.com/o/oauth2/auth
?
client_id={{oauth.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
access_type=offline
&
prompt=consent
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
redirect_uri={{oauth.redirect_uri}}
POST
https://oauth2.googleapis.com/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}