Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lukekulik opened this issue Jun 25, 2024 · 1 comment
Assignees

Comments

@lukekulik
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jpoehnelt @lukekulik and others