I am new to the Google API and web based programming so excuse my general ignorance. I am trying to use the Google Admin Audit APIs and have not found an example of how to make the call to get the ClientID to be able to make one of the Google API calls that require the CustomerID - like Admin Auditing. I have run other simple examples like retrieving Tasks list etc but the issue is that these types of calls do not require you to use a Customer ID.
I have all the right includes as per other Google API examples plus Google.Apis.Audit.v1 required for auditing. I have enabled the provisioning API in my admin console and I have created a new client based project in the API console and also enabled the Audit API service for the project.
Here is generally what I am doing:
public IAuthenticator GetServiceInterface()
{
ClientProvider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
ClientProvider.ClientIdentifier = "MY_CLIENT_ID";
ClientProvider.ClientSecret = "MY_CLIENT_SECRET";
IAuthenticator IAuth = new OAuth2Authenticator<NativeApplicationClient>(ClientProvider, GetAuthorization);
return IAuth;
}
private IAuthorizationState GetAuthorization(NativeApplicationClient client)
{
string[] ScopeList = new string[2] { "https://apps-apis.google.com/a/feeds/policies/", "https://www.googleapis.com/auth/apps/reporting/audit.readonly" };
IAuthorizationState IAuthState = new AuthorizationState(ScopeList);
IAuthState = AuthorizationMgr.RequestNativeAuthorization(client, ScopeList);
return IAuthState;
}
public void GoogleAuditTest()
{
//Get a Audit Service Interface
AuditService AuService = new AuditService( GetServiceInterface() );
????????????????????????????
...How do I get the CustomerID required by the audit service calls to list activities, etc
}
Am I missing something?