I need to open a new google meet room, and send it. I can't use standard "share" button in app. I need to catch the final url. I can't catch that with curl (it's not a normal redirect). My idea is that i need to open a request/link in background or in the same page, wait some second and catch the link, after i can release the page and user can enter.
Do you know something that can help me?
Edit: Yes, i had miss to tell that i need to generate a room from a click and catch the url from code. Generally, i should to make this with Google Calendar API, but in this case i can't.
I use google Calendar API. I make a webApp for my organization, that from a form (with user information to send togheter meet link) make a google calendar event with google meet room (from google loggedin user account), catch the link and send it by a smsGateway.
function FormForMeet(Args) {
// get calendar name, if it already exists
var meetsCalendar = CalendarApp.getCalendarsByName('CalendarName');
Logger.log(meetsCalendar.length)
if (meetsCalendar.length > = 1) {
// if some calendar be found, it catch the first, obviously here you can use some differet method. I had choose this because I don't expect to find more than 1
var calendar = meetsCalendar[0].getId();
}
else
{
// If miss, create new one.
var calendar = CalendarApp.createCalendar('CalendarName', {
summary: 'descrip Calendar',
// set a color of calendar label :D
color: CalendarApp.Color.PURPLE
});
calendar = calendar.getId();
}
// Call function to create meet
var LinkMeet = CreateConference_(calendar);
// here you can use what you want for send Args + LinkMeet);
// if you want return link
return LinkMeet;
}
// Function to create Conference. You can obviously use the code up without make a new function.
function CreateConference_(calendarId) {
// Custom of event, here I created the conferences according to my needs (now, with 1 h / conference)
var now = new Date();
var start = new Date(now.getTime()).toISOString();
var end = new Date(now.getTime() + (1 * 60 * 60 * 1000)).toISOString();
// generate random string to request
var rdmreqId = genStrg();
var event = {
"end": {
"dateTime": end
},
"start": {
"dateTime": start
},
"summary": "conferenceName",
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": rdmreqId
}
}
};
// insert event in calendar
event = Calendar.Events.insert(event, calendarId, {
"conferenceDataVersion": 1
});
// if use the function you can return the link to send
return event.hangoutLink
}
// random strind
function genStrg() {
var data = "something";
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789! @ # $% & <> * -";
for (var j = 2; j <= data.length; j++) {
text = ""; // Reset text to empty string
for (var i = 0; i < possible.length; i++) {
text + = possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
}