Skip to content

linkPreviewTriggers and createActionTriggers event JSON is missing docs.id and docs.title despite sufficient OAuth scopes #194

@lukekulik

Description

@lukekulik

Description

According to Google Workspace developer documentation docs event object should contain docs.id and docs.title if the https://www.googleapis.com/auth/drive.file scope has been authorized by the user.

However this is not the case in practice when attempting to deploy Google-provided example code for smart chips with the drive.file OAuth scope added. The docs event object only contains matchedUrl and it's missing docs.id and docs.title.

Code

Code from https://github.com/googleworkspace/add-ons-samples/tree/main/python/3p-resources with additional OAuth scope added (https://www.googleapis.com/auth/drive.file) and a print debug statement for event in create_link_preview/main.py

Output

{'commonEventObject': {'hostApp': 'DOCS', 'platform': 'WEB'},
 'authorizationEventObject': {'userOAuthToken': 'token1', 'userIdToken': 'token2', 'systemIdToken': token3'},
 'docs': {'matchedUrl': {'url': 'https://example.com/?name=123'}}} 

Note the last line in the output which only contains the matchedUrl field.

Steps to replicate

  • Deploy google-provided example code to Cloud Functions
  • Create, install and authorize the google workspace add-on
  • Paste a sample link that triggers the extension
  • Inspect logs for the deployed cloud function to verify the contents of the event object

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions