0

I am currently working on a simple Java application to query my organization's G Suite users. I am using the Google-provided Java API (Directory API). I am currently able to pull users, and their corresponding attributes using statements like the following:

String firstName = user.getName().getGivenName();
String lastName = user.getName().getFamilyName();
String email = user.getPrimaryEmail();

However, I do not know how to access attributes such as Employee ID, Employee type, department and title? I do not see any functions similar to the ones that I use to access first name, last name etc.

How do you access these values using the Java API? Any help is greatly appreciated!

Chris
  • 23
  • 1
  • 4

1 Answers1

0

You can see the properties you're looking for in Users Reference. Employee ID is under externalIds:

externalIds string A list of external IDs for the user, such as an employee or network ID.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • I know that this is possible to do using HTTP requests directly, by my project uses the Java API provided by Google. In the documentation, I see that there is a function.... getExternalIds() (for employee id?) or getOrganizations() (for department?). However I am unsure of how to use these functions. Is there an example? The Employee ID, Employee type, department and title are not custom fields-- they are built into the G Suite/Google Apps admin console by default. Thank you. – Chris Feb 22 '18 at 15:06