我想在一个应用程序中使用Google日历API,但我想获得一个Google见面链接(用于G Suite账户)。据我所知,这个选项是不可能的,还是我错了?
先谢谢你
根据 https:/cloud.google.comlogproductsapplication-developmenthangouts-meet-now-available-in-google。
你需要搜索带有 entryPointType = "video"
在ConferenceData.entryPoints[]中,然后你可以使用matchedObject.uri来获取Google meet的链接。
在Javascript的nodejs中,解决方案将是类似的东西。
var {google} = require('googleapis');
const eventId = "<yourEventId>";
const calendarId = "<yourCalendarId>";
const calendar = google.calendar({
version : "v3",
auth : auth
});
calendar.events.get({
calendarId,
eventId
}, ( err, res ) => {
if( err ) {
console.log( err );
} else {
const conferenceData = res.conferenceData;
if( conferenceData ) {
const entryPoints = conferenceData.entryPoints;
if( entryPoints ) {
const videoDetails = entryPoints.find( entryPoint => entryPoint.entryPointType == "video" );
if( videoDetails ) {
console.log( "Google Meet link", videoDetails.uri );
} else {
console.log( "No video details available" );
}
} else {
console.log( "No entry points available" );
}
} else {
console.log( "No conference data available" );
}
}
});