Lo hago en .NET utilizando el Google.GData.Client. Una vez que he ido, aunque el proceso de autorización y guardar las fichas, la próxima vez que mi usuario llega al sitio que tire de la autorización mediante la generación de un objeto GOAuthRequestFactory.
public GOAuthRequestFactory GetGoogleOAuthFactory(int id)
{
// build the base parameters
OAuthParameters parameters = new OAuthParameters
{
ConsumerKey = kConsumerKey,
ConsumerSecret = kConsumerSecret
};
// check to see if we have saved tokens and set
var tokens = (from a in context.GO_GoogleAuthorizeTokens where a.id = id select a);
if (tokens.Count() > 0)
{
GO_GoogleAuthorizeToken token = tokens.First();
parameters.Token = token.Token;
parameters.TokenSecret = token.TokenSecret;
}
// now build the factory
return new GOAuthRequestFactory("somevalue", kApplicationName, parameters);
}
Una vez que tengo la fábrica petición, puedo llamar a una de las diversas API que tengo permiso para usar y hacer algo como esto:
// authenticate to the google calendar
CalendarService service = new CalendarService(kApplicationName);
service.RequestFactory = GetGoogleOAuthFactory([user id]);
// add from google doc record
EventEntry entry = new EventEntry();
entry.Title.Text = goEvent.Title;
entry.Content.Content = GoogleCalendarEventDescription(goEvent);
When eventTime = new When(goEvent.StartTime, goEvent.EndTime.HasValue ? goEvent.EndTime.Value : DateTime.MinValue, goEvent.AllDay);
entry.Times.Add(eventTime);
// add the location
Where eventLocation = new Where();
eventLocation.ValueString = String.Format("{0}, {1}, {2} {3}", goEvent.Address, goEvent.City, goEvent.State, goEvent.Zip);
entry.Locations.Add(eventLocation);
Uri postUri = new Uri(kCalendarURL);
// set the request and receive the response
EventEntry insertedEntry = service.Insert(postUri, entry);
Todavía no sé lo que hice mal ; ¡pero de alguna manera funciona ahora! Gracias – Rhapsody