I'm trying to create a tool that administers all of my domain's users'
contacts. We have Google Apps Premier.

I'm having some trouble reading all the documentation (it is a little
overwhelming!), so I hope someone here can help me out.

I have enabled 2-legged OAuth for my apps. I'm trying to write a
Windows Form application in C# that grabs the "master" list of
contacts (basically, the admin profile's contact list, which will be
administered in Google Contacts), figure out who was added/removed,
and update everyone's contact list accordingly.

I was able to set up the ContactService by doing this:
GOAuthRequestFactory go = new GOAuthRequestFactory("cp",
"ContactsManager");
go.ConsumerKey = "mydomain.com";
go.ConsumerSecret = "myconsumersecret";

ContactsService cs = new ContactsService("ContactsManager");
cs.RequestFactory = go;

Then I did this and was able to retrieve the admin's contact list feed
info:
Uri contactsUri = new OAuthUri("https://www.google.com/m8/feeds/
contacts/default/full", "adminuser",
"mydomain");
ContactsQuery contactsQuery = new ContactsQuery();
contactsQuery.UseSSL = true;
contactsQuery.Uri = contactsUri;
contactsQuery.ShowDeleted = true;

ContactsFeed feed = cs.Query(contactsQuery);

foreach (ContactEntry entry in feed.Entries)
{
     Console.WriteLine(entry.Id.Uri.ToString() + " " +
entry.Deleted);
}

Now I am stuck. I don't know how to use this information to update
everyone's contact lists. Can anyone shed some light? Here are some of
my problems:

1. I don't know how to identify each user (so that I can access their
contact list to update) from the ContactEntry (which seems to be in
relation to the admin user's contact list). Now that I'm thinking
about it, perhaps I need to use Google Provisioning API to do that?
2. Even if I have a list of all the users, how do I figure out what
the URI (ie: the URI of the added/deleted contact) is to make a change
to the contact list?
3. I know I can create contacts (http://code.google.com/apis/contacts/
docs/2.0/developers_guide_dotnet.html#Creating), but that example they
have uses ContactRequest, which in turn uses RequestSettings... which
I don't know how to use with GOAuthRequestFactory (GAuthToken,
QueryAuthToken() are null).

Thanks in advance, I'd really appreciate any help/input anyone has!

--

You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=.


Reply via email to