Reputation: 5821
The documentation (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list#query-parameters) says you can use customFieldMask
to get only specific fields. I cannot figure out the format/structure of this property.
For example, given this for a user:
{
"kind": "admin#directory#user",
"id": "...",
"etag": "\"...\"",
"primaryEmail": "...",
"name": {
"givenName": "...",
"familyName": "...",
"fullName": "......"
},
"emails": [
{
"address": "...",
"primary": true
}
]
}
I only want to get primaryEmail
but I can't figure out how.
Upvotes: 1
Views: 1519
Reputation: 253
Send "users(primaryEmail)" in the fields parameter, not in the customFieldMask parameter.
Upvotes: 2
Reputation: 2203
The Directory API can't retrieve the 'primaryEmail' with the customFieldMask
attribute, with this attribute you can only specify the custom schema names that you create in the Admin console.
Upvotes: 0