Google Apps Security and Compliance Services Web Services Application Programming Interface Guide, Early Access Version 1.5 User Manual
Page 31
![background image](/manuals/552782/31/background.png)
Endpoint Resolver
29
C# Example
This v.1.5 C# example is using the PMP password (pword) for authentication.
The snippet example was created using Microsoft Visual Studio 2005.
try
{
//Create an instance of AutomatedBatch Reference
AutomatedBatchAPI.AutomatedBatchService wsAddUser = new
AutomatedBatchAPI.AutomatedBatchService();
//Create an Instance of the authElement
AutomatedBatchAPI.authElem authCredentials = new
AutomatedBatchAPI.authElem();
//Get the email address and password entered by the user Use the
xauth method instead of pword if the authentication is XAuth
authCredentials.apiKey = “
authCredentials.email = "
authCredentials.pword = "
// Retrieve the endpoint for the specified auth email and service,
setting it for our Automated Batch service.
wsAddUser.Url = new
EndpointResolverAPI.EndpointResolverService().GetServiceEndpoint(" piKey>",authCredentials.email,EndpointResolverAPI.service.v2Automate dBatch); //Create an instance of the extra argument structure for adduser AutomatedBatchAPI.adduserargs userExtraArgs = new AutomatedBatchAPI.adduserargs(); //adduser arguments are user address, fields, org, and welcome userExtraArgs.org = " //welcome message to users upon account creation userExtraArgs.welcome = " //user address String userAddress = " //AddUser Web Service request wsAddUser.adduser(authCredentials, userAddress, userExtraArgs);