Use the InsertEvent() function to create the appointment. Remove ['authGroup'] variable and getUserData() function.