set event id on google calendar java

后端 未结 2 887
悲哀的现实
悲哀的现实 2021-01-21 08:39

I tried to set the eventId on google calendar v3 api in Java, but it gave me 400 error with \"message\": \"Invalid resource id value.\". Is there any way to set the event Id of

相关标签:
2条回答
  • 2021-01-21 09:07

    I dont know why you cant set the id manually, I recently do that, because I wanted to know the id to retrieve it later. and I dont have any problem. probably you are doing it wrong.

    Event event = new Event();
    event.setId("cita1");
    client.events().insert("primary", event).execute();
    

    no errors

    0 讨论(0)
  • 2021-01-21 09:12

    Actually, the id field is writeable, see: [https://developers.google.com/google-apps/calendar/v3/reference/events][1]

    id string Identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules:

    characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938
    the length of the ID must be between 5 and 1024 characters
    the ID must be unique per calendar

    Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122.

    writable

    0 讨论(0)
提交回复
热议问题