Google Docs Component
Google Docs is an online word processor included as part of the free, web-based Google Docs Editors suite. Use the Google Docs component to create, and collaborate on online documents.
Component key: google-docs
Description
Google Docs is an online word processor included as part of the free, web-based Google Docs Editors suite. Use the Google Docs component to create, and collaborate on online documents.
Connections
Google Docs OAuth2
All requests to the Google Docs API must be authorized by an authenticated user.
The details of the authorization process, or "flow," for OAuth 2.0 vary somewhat depending on what kind of application you're writing. The following general process applies to all application types:
- When you create your application, you register it using the Google API Console. Google then provides information you'll need later, such as a client ID and a client secret.
- From APIs & Services > Library, enable the Google Docs API
- To create API Credentials navigate to Enabled APIs & Services > Credentials
- Select Create Credentials > OAuth Client ID
- Set the application type to ‘Web Application’
- Fill out the OAuth consent screen with an app name (your company or product's name), support email, app logo, domain, etc.
- Select Add Or Remove scopes, search Content API for Shopping, and check the boxes for the following scopes
- /auth/documents
- /auth/drive
- /auth/drive.file
- Under Authorized redirect URIs enter Prismatic's OAuth 2.0 callback URL:
https://oauth2.prismatic.io/callback
Click CREATE.- Take note of the Client ID and Client Secret that are generated, as you will enter them into Prismatic for Authentication.
Input | Default | Notes |
---|---|---|
Authorize URL string / Required Hidden Field authorizeUrl | https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent | The OAuth 2.0 Authorization URL for Google Docs |
Client ID string / Required clientId | Your Google Docs App's Client ID | |
Client Secret password / Required clientSecret | Your Google Docs App's Client Secret | |
Scopes string scopes | https://www.googleapis.com/auth/documents | Space delimited listing of scopes. See https://developers.google.com/docs/api/auth#scopes |
Token URL string / Required Hidden Field tokenUrl | https://oauth2.googleapis.com/token | The OAuth 2.0 Token URL for Google Docs |
Actions
Batch Update Documents
Applies one or more updates to the document. | key: batchUpdateDocuments
Input | Default | Notes | Example |
---|---|---|---|
Document ID string / Required documentId | The ID of the document to update. | ||
Connection connection / Required googleConnection | |||
Requests code requests | A list of updates to apply to the document. | ||
Required Revision ID string requiredRevisionId | The optional revision ID of the document the write request is applied to. If this is not the latest revision of the document, the request is not processed and returns a 400 bad request error. | https://developers.google.com/docs/api/reference/rest/v1/documents/batchUpdate#writecontrol | |
Target Revision ID string targetRevisionId | The optional target revision ID of the document the write request is applied to. | https://developers.google.com/docs/api/reference/rest/v1/documents/batchUpdate#writecontrol |
Create Document
Creates a blank document using the title given in the request. | key: createDocument
Input | Notes |
---|---|
Connection connection / Required googleConnection | |
Title string / Required title | The title of the document to create. |
Get Document
Gets the latest version of the specified document. | key: getDocument
Input | Default | Notes |
---|---|---|
Document ID string / Required documentId | The ID of the document to retrieve. | |
Connection connection / Required googleConnection | ||
Suggestions View Mode string suggestionsViewMode | DEFAULT_FOR_CURRENT_ACCESS | The suggestions view mode to apply to the document. |
Raw Request
Send raw HTTP request to Google Docs | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
File Data File Names string Key Value List fileDataFileNames | File names to apply to the file data inputs. Keys must match the file data keys above. | ||
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. | |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/v1/documents/{documentId}), The base URL is already included (https://docs.googleapis.com). For example, to connect to https://docs.googleapis.com/v1/documents/{documentId}, only /v1/documents/{documentId} is entered in this field. | /v1/documents/{documentId} | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. |