Tuesday, 15 February 2011

c# - Google Contacts API -



c# - Google Contacts API -

i started working google contacts api , can´t find illustration how work authentification stuff.

i used google contacts api version 3.0 documentation understanding basic workflow contacts api, have no thought how work authentification tokens.

after searching in web found tutorial google oauth2 c# in tutorial working usercredential object. in google contacts api version 3.0 documentation used requestsettings object. object has constructor accepts applicationname , gdatacredentials object.

so tried next code:

gdatacrendentials credentials = new gdatacredentials(clientid); credentials.username = "<my gmail username>"; this._requestsettings = new requestsettings(getapplicationname, _credentials);

the clientid got sec link posted.

so tried access contacts code:

feed<google.contacts.contact> f = _contactsrequest.getcontacts(); ilist<icontact> mappedcontacts = new list<icontact>(); foreach (var contact in f.entries) { //do stuff }

with code google.gdata.client.gdatarequestexception @ foreach:

{"execution of request failed: https://www.google.com/m8/feeds/contacts/default/full"}

could please give me suggestion wrong here?

there oauth2 sample included gdata .net client library:

https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/oauth2_sample/oauth2demo.cs

the relevant source code located here:

https://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/oauthutil.cs#200

c# .net google-api google-oauth google-contacts

No comments:

Post a Comment