Late last night I finally pieced something together that works
(working code posted below). However, I still have many unanswered
questions. Here's a few of them.

1) How do I retrieve the login message or the capcha during a login
failure?

2) How can I save and reuse the token. How long with the token last?
Is there some way I can check to see if I'm logged in or not. I admit
the whole login thing has me fairly confused.

3) How can I retrieve an error message in the event that inserting the
contact fails?



        Dim conserv As New ContactsService("MyCompany-MyApp-v1.0")
        Dim authFactory As New GDataGAuthRequestFactory("cp",
"MyCompany-MyApp-v1.0")
        authFactory.AccountType = "GOOGLE"

        conserv.RequestFactory = authFactory
        conserv.setUserCredentials("[email protected]",
"YourPassword")
        conserv.QueryClientLoginToken()

        Dim nc As New ContactEntry

        With nc
            .Name = New Google.GData.Extensions.Name()
            .Name.FullName = "John Davis"
            .Name.GivenName = "John"
            .Name.FamilyName = "Davis"
        End With

        Dim org As New Google.GData.Extensions.Organization()
        With org
            .Rel =
Google.GData.Extensions.ContactsRelationships.IsWork
            .Name = "Garfield"
            .Primary = True
        End With

        nc.Organizations.Add(org)

        Dim ph As New
Google.GData.Extensions.PhoneNumber("111-222-3333")
        With ph
            .Primary = True
            .Rel =
Google.GData.Extensions.ContactsRelationships.IsWork
            'I'm not sure when you need to use this
            '.Uri = "tel:+1111222333"
        End With
        nc.Phonenumbers.Add(ph)

        Dim urifeed As New
Uri(ContactsQuery.CreateContactsUri("default"))
        conserv.Insert(urifeed, nc)

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to