13

Where is the official documentation for the URL parameters/arguments?

There are things like /preview, /copy, /export, #headings, ?something question mark, that I stumbled on tips and tricks articles on the web.

Where is the Official URL documentation that explains ALL of them?

4 Answers 4

20

There is no official Google documentation for this. Let's have unofficial one:

/copy
/export
/edit
/view
/preview
/create
/pub?
/fm?id=
/tq?tqx=out:html
&key=[ID]
&gid=[#]
&single=[true|false]
&range=[CellAddress|CellAddress1:CellAddress2]
&embedded=[true|false]
&widget=[true|false]
&output=[html|txt|csv|pdf]
&format=[pdf|docx|xlsx|pptx]
&gridlines=[false]
&rm=[minimal|embedded|full|demo|?]
&ui=2 (interface version)
&chrome=[false] (full screen mode)
&width=[width]
&height=[height]
&frameborder=[size of border]
&q=[Search Query]
&viewer?
&start=
&channel=
&ibd=
&client=
&fmcmd=12
&size=0
&fzr=[true]
&portrait=[false]
&fitw=[true]
&printtitle=[true]
&sheetnames=[true]
&pagenum=[CENTER]
&attachment=[true]
&alt=[rss]
&tq=[query params here]

You may also be interested in this related question and answer about how to construct a specific URL to copy a template file into a specific folder. https://webapps.stackexchange.com/a/139589/266240

6
  • 1
    &copyDestination=[Drive FolderID]
    – katriel
    May 20, 2020 at 12:19
  • 1
    There is also userstoinvite which takes a string of emails separated by commas Dec 19, 2020 at 20:37
  • 2
    What do half of these even mean? Anyone figured out a way to completely disable the included UI buttons (i.e. I don't need pop-out, paging, or zoom buttons) Apr 17 at 17:05
  • 1
    THANKS. This info has been frustrating to find. Is there an option that prevents the Pop Out button at the top of the doument when the viewer is embedded in an iFrame ? What is the difference between /view and /preview/? Any chance someone can add comments to some of the less obvious options - such as, what does rm or fzr do?
    – rolinger
    Aug 28 at 17:14
  • @claudekennilol - I used CSS to hide the popout button and then sandboxed the iFrame to prevent the popout button from working: <iframe sandbox="allow-scripts allow-same-origin" ng-src= ... ><</iframe> - I got all that working cleanly, but now I need to find a way to enable/display a download button.
    – rolinger
    Sep 15 at 15:40
2

For Google Slides, I also use:

/embed
&loop=true
&delayms=[#]
&start=[true|false]
1
  • What do these parameters do? Please explain how this answers the question. Remember, the question is about Google Docs.
    – Rubén
    Sep 15 at 19:09
1

In a Cordova/Ionic app, I am embedding the following in an iFrame and found the following:

<iframe id="viewerFrame" sandbox="allow-scripts allow-same-origin" style="width:100%;height:100%;" frameborder="0" ng-src="https://docs.google.com/gview?url=https://exmple.com/files/5372967.pdf?t=1694794056384&amp;embedded=true"></iframe>

/gview - works

/view - does not work, URL 404, no error

/preview - does not work, URL 404, with error: X-Frame-Options set to sameorigin

/export - does not work, URL 404, with error: X-Frame-Options set to sameorigin

I currently have disabled gview script controls with the sandbox added to my iFrame, but if I can find a download button that would be visible in the embedded document then I would have to allow scripts to work again.

1
  • It's not clear how this answers the question, it looks more like a comment to another answer. As it is worded, it might be more relevant for Stack Overflow.
    – Rubén
    Sep 15 at 19:18
-1

Basically, no. It seems like it is difficult to find information on this because of the different versions. I couldn't find any page ever mentioning Google Sheets API v2 or v1, so I'm going to believe only v3 and v4 exist. When this question was posted, I believe it was only v3.

The top answer gives a pretty good list of your options, so here I'm just trying to find an official link for it.

Check this question out also, it's quite similar.

Currently this is the main/only documentation we've got. Within that, this is the exact page you want, but it only offers 3 query parameters. I've tried many others on my own sheets, so this definitely does not include everything. The ones here were working yesterday, but not today.

The other option seems to be the reference for Drive API (not specifically Sheets API). There is a Drive API v2 and v3. I haven't actually tried this out - some of the queries look familiar but may not actually work.

https://developers.google.com/drive/api/v2/about-files https://developers.google.com/drive/api/v3/fields-parameter https://developers.google.com/drive/api/v3/reference/files?hl=en https://developers.google.com/drive/api/v3/manage-downloads https://developers.google.com/drive/api/v3/ref-search-terms

Tidbits from these links that look interesting:

webContentLink  string  A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.  
webViewLink string  A link for opening the file in a relevant Google editor or viewer in a browser.

This guide for migration seems to be better than the documentation itself for what you want.

Lastly, there have been some promising lists in the Docs API, but if you have to go looking in sister products it's far from a useful reference link.

Posting as a draft, not sure when/if I'll get back to this.

1
  • This answer includes many links about Google Sheets and Google Drive but barely mentions something related to Google Docs, the Google Docs API. Please explain how this answer the question.
    – Rubén
    Sep 15 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.