问题
I'm creating a google calendar event using the Node.js Google Client API, I'm requesting a conference be created with the event using the following object:
var conferenceData =
{
createRequest:
{
requestId: uuid(),
conferenceSolutionKey:
{
type: "hangoutsMeet"
}
}
}
I get an error back from the server saying: Error: Invalid conference type value.
Which doesn't make any sense, since, according to this documentation hangoutsMeet
is an acceptable value:
The possible values are:
- "eventHangout" for Hangouts for consumers (http://hangouts.google.com)
- "eventNamedHangout" for classic Hangouts for G Suite users (http://hangouts.google.com)
- "hangoutsMeet" for Hangouts Meet (http://meet.google.com)
Anybody have any idea why it could be returning that error?
回答1:
I am facing the same problem at the moment. I believe it actually comes from the fact that the calendar where you try to insert the event does not accept the "hangoutsMeet" conference call type.
You can check that by using the API to get the calendar setup details, in conferenceProperties.allowedConferenceSolutionTypes: - https://developers.google.com/calendar/v3/reference/calendars/get - https://developers.google.com/calendar/v3/reference/calendars#resource
For my particular case, I can observe that the calendar only supports "eventNamedHangout", and "hangoutsMeet" is not listed.
That being said, I have no idea about how to actually make sure the "hangoutsMeet" type is supported by a specific calendar resource.
Edit
It seems that my problem was coming from the fact I was using a GCP service account - in that case what I observe is that only the eventNamedHangout type is supported. When sending the very same payload to the API with an access_token obtained via the oauth dance, hangoutsMeet becomes available.
回答2:
I got this working. As per the events docs you referred to, if providing conferenceSolution
then at least one entryPoint
must also be provided. Otherwise use createRequest
:
"Either conferenceSolution and at least one entryPoint, or createRequest is required."
回答3:
Does your uuid() return a string ?
and try smth like this instead :
const event = {
"conferenceData": {
"createRequest": {
"requestId": "someRandomKey",
"conferenceSolutionKey": {
"type": "hangoutsMeet"
}
}
}
};
来源:https://stackoverflow.com/questions/55655409/strange-error-message-being-returned-when-creating-calendar-event