tred
unread,Apr 22, 2012, 8:12:04 PM4/22/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Contacts, Shared Contacts and User Profiles APIs
I'm going in circles trying to get an event created for a contact. I
create the contact and send it to google but receive a:
"Bad Request When element does not have start date set or it's
malformed."
Seems to be related to the date of the When in the addEvent().
Documentation says "Only the @startTime attribute is supported.
Furthermore, its value must be a pure date, without the time
component."
Code I'm using is like this:
==============================================
//per documentation: Exactly one of the label and rel attributes must
be provided.
Event event = new Event(null, Event.Rel.ANNIVERSARY) ;
//convert a date string to a date
SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy");
Date date = (Date)f ormatter.parse(pojo.anniversary); // date is a
string formatted like "Mon, 25 Dec 2000 00:00:00 +0000"
When w = new When();
w.setStartTime( new DateTime( date ));
x.setWhen( w );
contact.addEvent(event);
==============================================
What am I missing?