Generate Join URL from user input on page

Currently I am attempting to generate a join url from a page where meetings are scheduled. The user creates the time and duration of meeting and creates a guest list of attendees with their email addresses. I need to send a join url to all attendees emails with the details of the meeting. I believe I have something that might work just need to know if I am headed in the right direction or not see below code.

function execute() {
  const url = "";
  const options = {
    method: "GET",
    headers: {
      "Accept": "application/json"
	if(ScheduledMeeting.MeetingTypeId == MeetingType.Virtual){
	"me", //For user-level apps, pass the *me* value instead of the *userId* parameter. 

	"agenda":'Scheduled Meeting',

	"default_password": True, //If this value is true and the user has the PMI setting enabled with a password, then the user's meetings will use the PMI password.

	"type": 2, //A scheduled meeting

	"pre_schedule": false,//Whether to create a prescheduled meeting via the GSuite app.

	"settings": {
       		 "host_video": true,
       		 "participant_video": true,
       		 "join_before_host": false,
        	 "mute_upon_entry": false,
        	 "watermark": false,
        	 "use_pmi": false,
        	"approval_type": 2,
        	"audio": "both",
        	"auto_recording": "none",
        	"enforce_login": false,
        	"registrants_email_notification": true
        	"waiting_room": true,
        	"allow_multiple_devices": true
		"encryption_type": "enhanced_encryption"
				invitees = []
				invitees.push(@user.EmailAddress)// this will create an array for all the invited guests to the meeting
	"registrants_confirmation_email": true, //Whether to send registrants an email confirmation

	"start_time": document.getElementById(ScheduledMeeting.MeetingTime).value,//Pass the value stored in the TIME txtbox,

	"duration": document.getElementById(ScheduledMeeting.MeetingDurationMinutes).value,//pass the value from the Duration txtbox,

  fetch(url, options).then(
    response => {
      if (response.ok) {
        return response.text();
      return response.text().then(err => {
        return Promise.reject({
          status: response.status,
          statusText: response.statusText,
          errorMessage: err,
    .then(data => {
    .catch(err => {