Pergunta

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 google calendar by ourselves?

thanks

Foi útil?

Solução 2

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

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top