beautypg.com

Google Apps Security and Compliance Services Web Services Application Programming Interface Guide, Early Access Version 1.5 User Manual

Page 53

background image

User Sync API

51

Exceptions

GetUsers Exception

InvalidCriteriaException - The search criteria could not possibly return any
results, or conflicting search criteria where specified.

Recommended Solution -- If this exception is thrown during the development
cycle, stop the application. To determine the specific error, either:

Confirm your application is not calling more than one organization matching
criteria at the same time, such as using InOrgHierarchy and
InAccountHierarchy.

Go to the Administration Console and confirm the organization exists and
you have administrative privileges to access this organization’s policy
settings. For more information about administrative privileges, see
“Authorization” on page 43.

API Infrastructure Exceptions

See “Exceptions” on page 44, and for exception handling
recommendations, see “Exception Management” on page 20.

GetUsers v1.5, JAX
WS Example

This v.1.5 JAX WS 2.0 example is using the PMP password (pword) for
authentication.

// AuthElem

AuthElem authElem = new AuthElem();

authElem.setApiKey("*your api key here*");

authElem.setEmail("*your admin user email here*");

authElem.setPword("*your admin password here");

// Setup our WS request.

GetUsersCriteria criteria = new GetUsersCriteria();

// Show every user in the account hierarchy this admin has

permissions to view.

criteria.setInAccountOrgHierarchy(true);

GetUsersControl control = new GetUsersControl();

// Return alias information for users.

control.setReturnAliases(true);

// Return API Attributes for users.

control.setReturnAttributes(true);

// Return approved sender addresses for users.

control.setReturnApprovedSenderAddresses(true);

// Return blocked sender addresses for users.

control.setReturnBlockedSenderAddresses(true);

// Retrieve users List =

syncPort.getUsers(authElem,criteria, control);