4

I am trying to replicate the JavaScript client library example shown on https://developers.google.com/drive/v2/reference/permissions/update#examples. There is a reference to permissionId. How do I get this, I've looked everywhere, and my assumption is I am missing something dead obvious.

Thanks in advance.

kuanb
  • 1,618
  • 2
  • 20
  • 42

1 Answers1

4

In a REST API such as Drive, every resource has a unique ID. Permissions are the same. When you create a permission, its ID is returned within the response. If you list permissions, you'll see it there. See https://developers.google.com/drive/api/v3/reference/permissions

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • Thanks, @pinoyyid. My goal is to create a Fusion Table and update the share setting to "Anyone who has the link can view." Am I barking up the wrong tree by pursuing permissions? I did not see a way to modify the share settings through the Fusion Tables API specifically. Thanks again. – kuanb May 06 '15 at 17:09
  • so here's the thing... "permissionId" is a string. The link you pointed me to, I don't see anywhere it's listing a bunch of strings which are permissions. When I want to call `update` I have no idea what I should set the value of this string to be, and neither the API page for `update` nor the linked page give me any clue. – Michael Apr 11 '22 at 20:27
  • and FWIW I'm trying to change ownership of the file, so I would assume it would be something like "OWNER" or something. – Michael Apr 11 '22 at 20:28
  • Perhaps you're thinking that permissions are properties of a file (a bit like in *nix for example). They aren't . Permissions are objects and as such, each Permission has a unique, opaque identifier, the permissionId. In order to find the permissionId of a particular permission, eg. in order to update it, you can call https://developers.google.com/drive/api/v3/reference/permissions/list in order to obtain a list of permissions with their permissionIds. – pinoyyid Apr 13 '22 at 18:25