Configuration to Query Users from a Google Apps domain

To be able to query Google Apps domain users, you must enable the following:

  1. An administrator of a Google Apps domain needs to login to the Google Apps Admin console, then select Security.

Google Admin Console

  1. Check Enable API access. The Admin SDK API must also be enabled.

Google Apps API Reference