Search code examples
google-apigoogle-docs-api

Remove a shared link to a google resource


As a followup to this how can I remove access to a document when I have established a shared link?

I would have assumed it was something like this (where I set the role to 'none') but that doesn't work:

POST /feeds/default/private/full/<resource_id>/acl
GData-Version: 3.0
Authorization: OAuth <access_token>

<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2007'>
<category scheme='http://schemas.google.com/g/2005#kind'
 term='http://schemas.google.com/acl/2007#accessRule'/>
  <gAcl:withKey key='dummy_key'>
     <gAcl:role value='none'/>
  </gAcl:withKey>
  <gAcl:scope type='default'/>
</entry>

Solution

  • You have to send a DELETE request to the ACL url, as explained at https://developers.google.com/google-apps/documents-list/#removing_sharing_permissions