20

I'm desperately trying to find where the google drive and google docs urls scheme and query parameters are documented. For example what is the usp= parameter which seems to have several possible values ? Also, why a link like this https://drive.google.com/drive/u/2/#folders/ will open a folder in Safari and Chrome without new authentication while a link like https://drive.google.com/drive/#folders/ will only work correctly in chrome. What is the meaning of u/2/ ? etc. Anyone knows how to find a complete documentation of these url schemes ?

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
Cédric NICOLAS
  • 1,006
  • 2
  • 12
  • 24

3 Answers3

29

As the part about /u/2/ has already been satisfactorily explained, I'll try to explain the part about usp from my best understanding.

It seems to just be providing data on from where you got access to the document.

usp=docs_home is when you create a new document from Google Docs itself
usp=drivesdk is given when you get a link using the Drive SDK
usp=sharing is when you get a link from the sharing dialogue
usp=drive_web is what you get when you click on a document in the Docs homepage or in Drive usp=direct_url is seen on the Docs homepage when you directly go to sheets.google.com or slides.google.com

There are probably more to be found, but it doesn't seem to be doing anything other than likely providing referrer information. Replacing usp=sharing with anything else still doesn't seem to stop you from retrieving a document, and it seems unlikely that this would be a document-specific property as it is also seen on other Google URLs, like the slides/sheets homepage.

Venkatesh Kumar
  • 421
  • 4
  • 6
  • 4
    Nice work, thanks! (From what you found out, an educated guess for what `usp` abbreviates could be "URL source parameter" (but at least the p part is probably something else).) – Aaron Thoma Jan 28 '17 at 03:28
  • Was this just hard-won knowlege, or did you find some documentation defining &usp to get your research started? – BobHy Dec 05 '19 at 20:54
9

/u/2/:

  • u stands for user
  • 2 denotes the third° user account you logged into – in the current browser (profile). That means that the same number can get associated with a different Google account in each browser (profile), if you first log in in a different order per browser (profile).
        ° 2+1 due to counting zero-based: The first account is /u/0/.

Source: my experience with Google Mail and Contacts

Community
  • 1
  • 1
Aaron Thoma
  • 3,820
  • 1
  • 37
  • 34
-1

It depends on what you need to do and from where but the site where Google breaks down their mystery is located at: https://developers.google.com/drive/

randomblink
  • 215
  • 1
  • 13
  • 4
    yes but where here ? Anyway, i've finally did completely differently by doing most of my authentication server side, then i don't need anymore to redirect user to those kind of urls... – Cédric NICOLAS Aug 06 '15 at 15:16