GoogleDocs
Use the Google Docs integration to create and modify Google Docs documents.
Utilities · Google Docs
Details
| ID | GoogleDocs |
|---|---|
| Provider | |
| Category | Utilities |
| From Version | 5.0.0 |
| Docker Image | demisto/googleapi-python3:1.0.0.115338 |
| Supported Modules | Agentix XSIAM |
README
Use the Google Docs integration to create and modify Google Docs documents.
Configure GoogleDocs in Cortex
| Parameter | Description | Required |
|---|---|---|
| service_account_credentials | Service Account Private Key file contents (JSON) | True |
| insecure | Trust any certificate (not secure) | False |
| proxy | Use system proxy settings | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
google-docs-get-document
Returns the document that matches the specified document ID.
Base Command
google-docs-get-document
Input
| Argument Name | Description | Required |
|---|---|---|
| document_id | The document ID of the document to fetch. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GoogleDocs.Title | String | The title of the document. |
| GoogleDocs.RevisionId | String | The revision ID of the updated document. |
| GoogleDocs.DocumentId | String | The document ID of the updated document. |
Command Example
!google-docs-get-document document_id=1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo
Context Example
{
"GoogleDocs": {
"DocumentId": "1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo",
"RevisionId": "ALm37BWMd6E3RFLJAI4uq5BdFTiJyeKWjjcVwRdHqv33lE2EWEPv7znT1PmdlB4zLv3xxpTIXlVRJ2Rq71lMCg",
"Title": "testing"
}
}
Human Readable Output
The document with the title testing was returned. The results are
DocumentId RevisionId Title 1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo ALm37BWMd6E3RFLJAI4uq5BdFTiJyeKWjjcVwRdHqv33lE2EWEPv7znT1PmdlB4zLv3xxpTIXlVRJ2Rq71lMCg testing
google-docs-create-document
Creates a document.
Base Command
google-docs-create-document
Input
| Argument Name | Description | Required |
|---|---|---|
| title | The title of the document to create. | Required |
Context Output
| Path | Type | Description |
|---|---|---|
| GoogleDocs.Title | String | The title of the new document. |
| GoogleDocs.RevisionId | String | The revision ID of the new document. |
| GoogleDocs.DocumentId | String | The document ID of the new document. |
Command Example
!google-docs-create-document title="testing"
Context Example
{
"GoogleDocs": {
"DocumentId": "12YHG7OISB99ANM3GTbtK9IveiBxyrndnDGuRyyRiA5U",
"RevisionId": "ALm37BWqvcEhS-G00EiPhh2ge7RZz4mYof8Fws-lFE5HfBPwILQJ8ZXmTY0XZCB3sg9a1xiTNzU_jJnFewwaHw",
"Title": "testing"
}
}
Human Readable Output
The document with the title testing was created. The results are
DocumentId RevisionId Title 12YHG7OISB99ANM3GTbtK9IveiBxyrndnDGuRyyRiA5U ALm37BWqvcEhS-G00EiPhh2ge7RZz4mYof8Fws-lFE5HfBPwILQJ8ZXmTY0XZCB3sg9a1xiTNzU_jJnFewwaHw testing
google-docs-update-document
Updates the document with the specified document ID.
Base Command
google-docs-update-document
Input
| Argument Name | Description | Required |
|---|---|---|
| document_id | The document ID of the document to update. | Required |
| actions | Updates to the document in the format: action1{param1,param2,…};action2{param1,param2,…}. | Required |
| required_revision_id | The target revision ID of the document to which the write request will be applied. If a newer revision exists you will receive an error. If you specify the target_revision_id argument, you cannot use this argument. | Optional |
| target_revision_id | The target revision ID of the document to which the write request will be applied. If a newer revision exists you will receive an error. If you specify the required_revision_id argument, you cannot use this argument. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GoogleDocs.Title | String | The title of the updated. |
| GoogleDocs.RevisionId | String | The revision ID of the updated document. |
| GoogleDocs.DocumentId | Unknown | The document ID of the updated document. |
Command Example
!google-docs-update-document document_id=1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo actions=insertText{1,hey};insertText{3,hello}
Context Example
{
"GoogleDocs": {
"DocumentId": "1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo",
"RevisionId": "ALm37BWCZhPcqsQ0g1oatbiEtHz2vLXIkZwn9Rt-y0riIUKiuQOfvByrPlJsDW9uW3DRkSwZ7vLBgLgDrrnW9g",
"Title": "testing"
}
}
Human Readable Output
The document with the title testing and actions insertText{1,hey};insertText{3,hello} was updated. the results are
DocumentId RevisionId Title 1MjtBlFLwFNsjVwCF0mZLxpRoblVHjLcR3VmZcUuNvzo ALm37BWCZhPcqsQ0g1oatbiEtHz2vLXIkZwn9Rt-y0riIUKiuQOfvByrPlJsDW9uW3DRkSwZ7vLBgLgDrrnW9g testing
Configuration parameters
service_account_credentials— Service Account Private Key file contents (JSON)credentials_service_account—insecure— Trust any certificate (not secure)proxy— Use system proxy settings
Commands (3)
-
google-docs-create-documentCreates a document.
-
google-docs-get-documentReturns the document that matches the specified document ID.
-
google-docs-update-documentUpdates the document with the specified document ID.
##Creating a Service Account 1. Go to the [Google documentation](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) and follow the procedure in the Creating a Service Account section. After you create a service account, a Service Account Private Key file is downloaded. You will need this file when configuring an instance of the integration. 2. Grant the Compute Admin permission to the Service Account to enable the Service Account to perform certain Google Cloud API commands. 3. In Cortex XSOAR, configure an instance of the Google Cloud Compute integration. For the Service Account Private Key parameter, add the Service Account Private Key file contents (JSON). ##Create document command: Creates a blank document. It's not possible to pass body arguments. That's a limitation by the google api. For inserting content you should the update document command. ##Update document command: Update a document based upon it's ID. Actions to perform are passed in the following format: * action1{param1,param2,...};action2{param1,param2,...}... It is then converted to: * action1(param1,param2,...), action2(param1,param2),... where action1 is the function name to be called and param1 and param2 are the parameters For example: insertText(5,hello) insertTable(5,7,7);insertText(5,hello) ###List of allowed actions: -createNamedRange(start_index, end_index, name, segment_id(optional)) -createParagraphBullets(start_index, end_index, bullet_type, segment_id(optional)) -deleteContentRange(start_index, end_index, segment_id(optional)) -deleteNamedRangeByName(name) -deleteNamedRangeById(named_range_id) -deleteParagraphBullets(start_index, end_index, segment_id(optional)) -deletePositionedObject(object_id) -deleteTableColumn(index, row_index, column_index, segment_id(optional)) -deleteTableRow(index, row_index, column_index, segment_id(optional)) -insertInlineImage(index, uri, width, height, segment_id(optional)) -insertPageBreak(index, segment_id(optional)) -insertTable(index, rows, columns, segment_id(optional)) -insertTableColumn(index, row_index, column_index, insert_below, segment_id(optional)) -insertTableRow(index, row_index, column_index, insert_below, segment_id(optional)) -insertText(index, text, segment_id(optional)) -replaceAllText(source, target, match_case)