google-api-java-client icon indicating copy to clipboard operation
google-api-java-client copied to clipboard

Could not insert event with Bad request

Open dmytr0 opened this issue 4 years ago • 1 comments

I want to create Event in calendar with such code

         Event event = new Event()
                .setSummary("Vacation from app")
                .setLocation("800 Howard St., San Francisco, CA 94103")
                .setDescription("A chance to hear more about Google's developer products.");
    DateTime startDateTime =  new DateTime("2020-11-10T00:20:50.52Z");;
    EventDateTime start = new EventDateTime()
            .setDate(startDateTime)
            .setTimeZone("Europe/Kiev");
    event.setStart(start);
    DateTime endDateTime = new DateTime("2020-11-10T23:20:50.52Z");
    EventDateTime end = new EventDateTime()
            .setDate(endDateTime)
            .setTimeZone("Europe/Kiev");
    event.setEndTimeUnspecified(true);
    event.setEnd(end);
    googleCalendar.events()
            .insert(calendarId, event)
            .execute();`

But receive a response

{ "code" : 400, "errors" : [ { "domain" : "global", "message" : "Bad Request", "reason" : "badRequest" } ], "message" : "Bad Request" }

From this message I really do not understand which data is bad...

dmytr0 avatar Nov 10 '20 20:11 dmytr0

great support.

3 years later and I'm facing the same error.

@dmytr0 I'm guessing you haven't found the reason for it

dahool avatar Oct 23 '23 18:10 dahool

Closing this issue as we are unable to provide adequate customer support through this forum. If you feel there is a bug or a feature request associated with this ticket, please open a new issue. Otherwise, https://cloud.google.com/support is best able to provide timely answers to API-specific questions.

burkedavison avatar Sep 26 '24 18:09 burkedavison