Matt Greco
Matt Greco

Reputation: 11

Any way to get "Employee Details" from Google API?

Is anyone aware of any Google API with the user scope (NOT the Admin API in the Directory SDK) that allows you to retrieve the custom employee attributes?

The G+ API seems to skip these https://developers.google.com/+/web/api/rest/latest/people#resource

Our issue is that we don't want to grant access to the developer console, but rather do this PER-USER. I.E. a user logs into our app and we display to her the custom attributes for her G Suite account, but we do this as her (not as an approved API scope via the dev console).

Upvotes: 1

Views: 1073

Answers (1)

Jacob Wrenn
Jacob Wrenn

Reputation: 548

Leaving this answer for anyone like me who finds this question.

The Directory API allows a user to query the custom attributes for their account even without any admin permissions at all.

https://developers.google.com/admin-sdk/directory/v1/reference/users/get

You need to ensure that projection is set to full and viewType is set to domain_public.

You may need to check the permissions for reading the custom attributes to ensure that a user is allowed to see theirs. We do this in the Google Cloud Directory Sync.

Upvotes: 2

Related Questions