1

I am looking for a way to get from any google apis a list of not-suspended users in an organization, using oath authorization.

google profile api has oauth, but the user list returned does not contain the isSuspended flag.

google provisioning api returns isSuspended flag, but as far as I understand cannot be OAUTH authorized.

are there any other options I have to accomplish this?

bazik
  • 609
  • 3
  • 18

1 Answers1

2

Yes, the Provisioning API works with OAuth 1.0 and 2.0. See the docs and necessary scopes here.

If you just need all users in the entire Google Apps instance, use the retrieve all users in all domains API call and then filter out users with isSuspended = True.

If you also need to filter the list down to users under a certain organizational unit (OU), use the Retrieving An Organization Unit's Immediate Sibling Users API call also and then filter down your list to users who are in the OU and are not disabled.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • thanks a ton, I'd swear I read the prov api page top-to-bottom a few times but somehow missed where it links to the first link you posted. that really saves my behind, thanks! – bazik May 09 '13 at 15:06
  • Hey Jay, I have no luck in retrieving all users. I walked through [this docs](https://developers.google.com/admin-sdk/directory/v1/reference/users/list) but I get 401 all the time - how do I make this GET request to work? Which headers does it expect? Thanks in advance! – Andrey Deineko Sep 12 '16 at 12:11