Using Google Contacts API to access contacts for other users in Google Apps domain
Tag : chash , By : Sigtryggur
Date : March 29 2020, 07:55 AM
I hope this helps you . OK, I finally figured it out. I feel like this probably isn't the way it's supposed to work and I had to dig around the source code of ServiceAccountCredential, but it works. I actually have this split out a bit, but for the sake of clarity here it is altogether. I also switched from Google.Apis.Authentication to Google.Apis.Auth. public static Feed<Contact> MakeRequest(string userId, int numberToRetrieve = 9999)
{
var serviceCredential = new ServiceAccountCredential(new ServiceAccountCredential.Initializer(ServiceEmail)
{
Scopes = new[] { @"https://www.google.com/m8/feeds/" },
User = userId,
}.FromCertificate(Certificate));
var reqAccessTokenInfo = serviceCredential.GetType()
.GetMethod("RequestAccessToken", BindingFlags.Instance | BindingFlags.NonPublic);
var task = (Task<bool>) reqAccessTokenInfo.Invoke(serviceCredential, parameters: new object[] {new CancellationToken()});
task.Wait();
var settings = new RequestSettings(Properties.Settings.Default.ApplicationName, serviceCredential.Token.AccessToken);
var cRequest = new ContactsRequest(settings);
var query = new ContactsQuery(ContactsQuery.CreateContactsUri(userId)) { NumberToRetrieve = numberToRetrieve };
return cRequest.Get<Contact>(query);
}
|
No contacts returned using Google Domain Shared Contacts API
Tag : php , By : user165871
Date : March 29 2020, 07:55 AM
this one helps. I'm on a google apps domain for education and I'm trying to use the Domain Shared Contacts API to access the shared contacts. I'm using the google php api client with a service account for which I have enabled the correct APIs and added the appropriate scopes similar to steps 1-5 of this answer: Is it possible to use "Domain-wide Delegation of Authority" with gdata-python-client? , I am delegating to a super admin user
|
Retrieve the list of users in a Google Apps Domain with a non-admin account
Date : March 29 2020, 07:55 AM
|
Domain Shared Contacts API with Google Apps
Date : March 29 2020, 07:55 AM
|
Google Apps Scripts & Shared Contacts Access to a Google Apps for Education
Date : March 29 2020, 07:55 AM
|