I’ve been working with the Google Docs API and found documentation about retrieving documents that contain suggestions or track changes. However, I can’t seem to find any clear information about how to actually create or insert suggestions into a document programmatically.
I need to implement a feature where my application can add text suggestions to existing documents, similar to how the suggestion mode works in the Google Docs interface. Is there a way to programmatically insert editing suggestions into a document using either the Google Docs API or Google Apps Script?
Any examples or guidance would be really helpful since the official documentation seems to focus only on reading suggestions rather than creating them.
Unfortunately, the Google Docs API does not support creating suggestions programmatically. I encountered this issue while developing a document review application a while back. The API can only read existing suggestions but cannot generate new ones. As a workaround, I utilized the batchUpdate method to add comments on specific text sections where I desired changes. While this approach does not replicate the suggestion function, it allows for marking areas for review with comments. I also explored Google Apps Script with DocumentApp, but it lacks methods for suggestion creation. The suggestion feature is only accessible through the web interface. Another option is to highlight text with comments outlining your proposed changes or utilize text formatting alongside comments to create an approximate suggestion process.
yeah, super frustrating limitation. I switched to a custom workflow - store changes externally, then batch update once approved. you could also use named ranges to flag review sections and add comments for suggested changes. not perfect, but works well enough for most stuff.
Hit the same wall building a content review system last year. Google Docs API doesn’t let you create suggestions - super annoying since it reads them just fine. I went with a hybrid setup instead. My app tracked proposed changes in its own database, then pushed them as regular edits once approved. For user feedback, I’d insert comments at specific spots using insertText with the right ranges, then highlight those sections with background colors or different text styles to show pending changes. Not as clean as real suggestions, but it got the job done. The trick was managing suggestion state outside Google Docs and keeping everything synced.