Question
Can anyone point me to a step-by-step example which explains how to get started with the Google Contacts API and shows a complete working demo?
Preferably in Java, but it can also be in C#, Python or Ruby.
Goal
All I want to do is to
Problems
I am pretty much failing on every level.
Example
Here is some pseudo-code of what I am looking for.
import com.google.contacts.*
public class UpdateContactDemo {
public static void main(String args[]) {
GoogleContactsApi g = new GoogleContactsApi("username", "password");
Contact c = g.get("Bob");
c.addGroup("Friends");
g.save(c);
}
}
What I already did
Ok, I googled for tutorials, API examples and everything else I could think of -- and failed. I found a bunch of sources like these:
But non contained an end-to-end example for beginners.
My approach for C# was this one:
http://nanovazquez.com/2013/01/18/working-with-google-calendar-on-dotnet/
The code can be found on github: here
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<appSettings>
...
<!-- GoogleAPI credentials -->
<add key="ClientId" value="{CLIENT-ID}" />
<add key="ClientSecret" value="{CLIENT-SECRETD}" />
<!-- Update the port of the Redirect URI (don't forget to set this value also in the Google API Console) -->
<add key="RedirectUri" value="http://localhost:{PORT}/Account/GoogleAuthorization" />
</appSettings>
<system.web>
...
</configuration>
</xml>
You can remove the existing Google Calendar api and add Google Contacts Api.
Give this a try.
This has Oauth implementation and works, but the code samples from the code.google.com don't.
Is the best I found so far.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With