0

I am trying to use this but after insert event, the property ConferenceData is null

var pm = new Dictionary<string, string>
                    {
                        {"conferenceDataVersion", "1"}
                    };

calenderEvent.ConferenceData.Parameters = new ConferenceParameters(); calenderEvent.ConferenceData.Parameters.AddOnParameters = new ConferenceParametersAddOnParameters(); calenderEvent.ConferenceData.Parameters.AddOnParameters.Parameters = pm;

1 Answers1

4

You don't need to use the Parameters property in order to set ConferenceDataVersion.

  • If you just want to add a conference to the Event, you can set the ConferenceDataVersion as a parameter of your request before executing it.
  • You also have to make sure that the request body has the appropriate conference data properties (requestId, conferenceSolutionKey, etc.).

For example:

Event newEvent = new Event()
{
    ConferenceData = new ConferenceData()
    { 
        CreateRequest = new CreateConferenceRequest()
        { 
            ConferenceSolutionKey = new ConferenceSolutionKey()
            { 
                Type = "hangoutsMeet" // Change according to your preferences
            },
            RequestId = "XXXXX" // Unique request ID
        }
    },
    // ... Rest of event properties (start, end, attendees, name, etc.)
};
EventsResource.InsertRequest request = service.Events.Insert(newEvent, calendarId);
request.ConferenceDataVersion = 1; // Set conference data version
Event createdEvent = request.Execute();
Iamblichus
  • 18,540
  • 2
  • 11
  • 27
  • Hi, can you help me pls? Well.. I'm trying to create the event in Google Calendar with videoconference video but I get this error: **Google.Apis.Requests.RequestError Invalid conference type value. [400] Errors [Message[Invalid conference type value.] Location[ - ] Reason[invalid] Domain[global] **. The source code I'm trying is this [url](https://github.com/jesustorrst/GoogleMeetTest/blob/master/GoogleMeetTest/GoogleMeetTest/Program.cs) do you have any example to create an event pls? – Jesús Torres Torres Feb 05 '21 at 14:49
  • @JesúsTorresTorres Hi! I'd suggest you to post a new question and add the relevant parts of the code you're working on. – Iamblichus Feb 05 '21 at 15:03
  • Thanks, I posted thw new question [here](https://stackoverflow.com/questions/66066279/how-to-create-event-with-videoconference-in-google-meet-in-c-sharp-using-google) – Jesús Torres Torres Feb 05 '21 at 15:47