2

I want to write a programm in Java, which is able to remove a Participant from a Google Calendar Event. Right now my programm only returns the Events of a Calendar by its CalendarID. I've used the Code of the Google Developers Site (Calendar API V3). After the authorization process is over, the code creates a new object named "service"

    Calendar service = new Calendar.Builder(httpTransport, jsonFactory,
            credential).build();

    getAllEvent(service);

With this

  events = service.events().list("CalendarID")
                .setPageToken(pageToken).execute(); 
List<Event> items = events.getItems();

I get a list of all Events from my Calendar, but I want to get the Participants and then i want to delete a special participant from the event. Could someone give me an easy Code-snippet or help? I've tried

 service.events().list("CalendarId").getParticipants or "getAttendees"

but there isn't a method like that.

1 Answer 1

0

The basic approach would be to:

  • Establish a new List then
  • Iterate the current list looking for matches.
  • If matched, add the element to the new list.

And as an aside, this is 'programming 101'. You should probably steer clear of web API's until you have the basics of the language and coding sorted.

1
  • I think you might misunderstood my question because of the last Code-block I've posted. I'm looking for a method that returns the participants. The last Code-block I've posted is NOT working. I simply want to know which command I need, which needs an "calendarId" and "eventId" to return the participants. Many thanks in advance! Apr 29, 2013 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.