0
votes

We are working with Google Drive and Permissions API to get e-mail addresses of users with sharing permissions. The API might not return the e-mail address if user forbids this in Google+ profile.

The documentation to Google Drive Permissions API says:

The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.

After few hours of searching, we cannot find this "profile privacy settings" in question. Google Account Settings shows no such field.

Anybody knows where it is?

1
Not an answer, but a heads up. If you are using email address as a user identifier, you may have issues. It's generally safer and easier to use the Google User Idpinoyyid
Yes, sure. But the point here is: We showed this documentation to client and now he asks where he can turn it on/off in his profile to instruct his employees.krtek
Clients huh. Who needs 'em lolpinoyyid

1 Answers

1
votes

With "profile privacy settings" they mean that the Google + profile have shared the email from the contact information with the profile you are authenticated for the request.

I've made some test with a couple of documents, both shared with "Anyone with the link can view", but the first is from a user that shares with me the email in contact information.

Using the Try It I get the following result:

{
   "kind": "drive#permission",
   "etag": "\"SQFIsIrlQ4j3H07nwR6GyVXbP4s/4mfL2lpQkyuoRKmfVUHuvQuo5DI\"",
   "id": "yyyyyyyyyyyy",
   "selfLink": "https://content.googleapis.com/drive/v2/files/1ypzfcjfxIusRz0rLoDYh49DqPUj9DdZJI3lCGLtCkn8/permissions/yyyyyyyyyyyyy",
   "name": "NAME Surname",
   "emailAddress": "[email protected]",
   "domain": "gmail.com",
   "role": "owner",
   "type": "user",
   "photoLink": "https://lh4.googleusercontent.com/-DRgxkD0Vigg/AAAAAAAAAAI/AAAAAAAAZ0g/dszVFwA6bUo/s64/photo.jpg"
}

The second file is from a test account that doesn't share the email with me. And I get the following:

{
   "kind": "drive#permission",
   "etag": "\"SQFIsIrlQ4j3H07nwR6GyVXbP4s/eUBKpMiVeQhLf3_Rf4Us5qisOqU\"",
   "id": "ooooooooookkkkkkk",
   "selfLink": "https://content.googleapis.com/drive/v2/files/1IpGtyYgJ_K6b0Xp2TWuYrcCTfPrIGJoUrStMPCyWGgM/permissions/kkkkkkkkkk",
   "name": "lkajdlkj oiuaoiuoi",
   "domain": "gmail.com",
   "role": "owner",
   "type": "user",
   "photoLink": "https://lh3.googleusercontent.com/-SUCY0jPNqsA/AAAAAAAAAAI/AAAAAAAAMEk/8Y7SD9VNhHE/s64/photo.jpg"
  }

As you can see the emailAddress is not displayed in the second result

To change this setting in your Google+ profile follow this steps (or the official help page):

  1. Go to your account on https://plus.google.com
  2. When the page is loaded in the top left corner, hover to the Home Menu
  3. Click on Profile
  4. Open the About tab of your profile (top center)
  5. Scroll down to the Contact Information and click edit
  6. Home and Work contacts can be shared to different circles or remove all the circles to make the contacts fully private