Skip to content

Add Forms Publishing related samples #2176

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

vibhorrawal
Copy link
Contributor

@vibhorrawal vibhorrawal commented May 27, 2025

Forms recently launched publishing APIs, https://developers.google.com/workspace/forms/docs/release-notes#April_08_2025, this change provides snippets on how to use them.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have performed a peer-reviewed with team member(s)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@jpoehnelt jpoehnelt requested a review from Copilot May 27, 2025 16:11
@jpoehnelt jpoehnelt assigned jpoehnelt and unassigned sqrrrl May 27, 2025
@jpoehnelt jpoehnelt self-requested a review May 27, 2025 16:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a suite of Python snippets demonstrating how to use the new Forms publishing APIs. The samples cover various use cases including publishing, unpublishing, stopping responses, and managing responders.

  • Introduces eight independent sample scripts for different publishing-related operations.
  • Separates responsibilities between form publish settings (using the Forms API) and responder permissions (using the Drive API).

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
forms/snippets/unpublish_form.py Sample to unpublish a form by updating its publish settings.
forms/snippets/supports_publishing.py Checks if a form supports publishing by verifying metadata fields.
forms/snippets/stop_accepting_responses.py Keeps the form published while stopping new responses.
forms/snippets/remove_responder.py Removes a responder by deleting their permission on the form.
forms/snippets/publish_form.py Publishes a form by updating its publish settings.
forms/snippets/get_responders.py Retrieves the list of responders based on Drive permissions.
forms/snippets/anyone_with_link_responder.py Provides functions to check, set, and remove the “anyone with the link” responder permission.
forms/snippets/add_responder.py Adds a specific responder by granting them reader permission using the Drive API.
Comments suppressed due to low confidence (1)

forms/snippets/publish_form.py:27

  • Verify that using the 'drive.file' scope for publishing is intended since other publishing samples use 'forms.body'—clarifying the reasoning here would improve API consistency.
"https://www.googleapis.com/auth/drive.file",

@vibhorrawal vibhorrawal force-pushed the feature/publish-forms branch from 1ec9e90 to 1cd7449 Compare May 27, 2025 16:12
@vibhorrawal vibhorrawal force-pushed the feature/publish-forms branch from 1cd7449 to aa7d39d Compare May 27, 2025 16:15
@jpoehnelt jpoehnelt merged commit 8523ee5 into googleworkspace:main May 27, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants