Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/gcsconsultores/centros-estrategicos-gcs/llms.txt

Use this file to discover all available pages before exploring further.

The Teams integration creates calendar events with embedded Teams meeting links via the Microsoft Graph API. When a client requests a meeting from the Sala Ejecutiva, the /api/meetings route authenticates as a service principal, creates the event in the organizer’s Microsoft 365 calendar, and returns a joinUrl that the client can use to join the meeting — no Teams account required on the client’s side. The join link works in any modern browser via the Teams web app.

How It Works

1

Client submits a meeting request

The user selects a meeting type and fills out the contact form in the Sala Ejecutiva of the virtual office.
2

POST /api/meetings is called

The front end sends a POST request to /api/meetings with the fields titulo, fecha (ISO 8601), duracionMinutos, sala, and an asistentes array containing nombre and email for each attendee.
3

Azure AD authentication

The API route acquires an OAuth2 access token from Azure AD using the client_credentials grant — the same flow used for SharePoint. No user interaction is required.
4

Calendar event created via Graph API

A POST request is sent to /v1.0/users/{organizerEmail}/events with isOnlineMeeting: true. Microsoft Graph automatically generates a Teams meeting link and attaches it to the event.
5

joinUrl returned to the client

The Graph API response includes onlineMeeting?.joinUrl. The API route extracts this URL and returns it to the client in the response body.
6

Join link delivered to attendees

The join URL can be included in an email confirmation or displayed directly in the virtual office UI. Attendees receive a calendar invite with the Teams link embedded.

Event Creation Body

The following object is sent to the Microsoft Graph API when creating a Teams meeting event. Dates are calculated from the fecha and duracionMinutos fields in the request body.
{
  subject: meetingData.titulo,
  body: {
    contentType: 'HTML',
    content: `
      <h2>Reunión - Oficina Virtual GCS</h2>
      <p><strong>Sala:</strong> ${meetingData.sala}</p>
      <p>${meetingData.descripcion || 'Reunión agendada desde la Oficina Virtual de GCS Consultores Empresariales.'}</p>
      <hr>
      <p><em>Esta reunión fue creada automáticamente desde la Oficina Virtual GCS.</em></p>
    `,
  },
  start: {
    dateTime: startDate.toISOString(),
    timeZone: 'America/Bogota',   // Colombian timezone (UTC-5)
  },
  end: {
    dateTime: endDate.toISOString(),
    timeZone: 'America/Bogota',
  },
  location: {
    displayName: `Oficina Virtual GCS - ${meetingData.sala}`,
  },
  attendees: meetingData.asistentes.map((asistente) => ({
    emailAddress: { address: asistente.email, name: asistente.nombre },
    type: 'required',
  })),
  isOnlineMeeting: true,
  onlineMeetingProvider: 'teamsForBusiness',
}

Required Permissions

The Calendars.ReadWrite Application permission must be granted on your Azure AD App Registration to create calendar events on behalf of any user in the tenant. See the Microsoft 365 setup guide for instructions on adding and granting this permission.
PermissionTypePurpose
Calendars.ReadWriteApplicationCreate and manage Teams meeting events in user calendars

Organizer Account

The meeting is created under the calendar of the account specified by DEFAULT_ORGANIZER_EMAIL. This is the account that appears as the meeting organizer in Teams and in attendees’ calendar invites.
  • The organizer account must be a licensed Microsoft 365 user — unlicensed accounts cannot hold calendar events.
  • Set DEFAULT_ORGANIZER_EMAIL in .env.local to apply it globally as the fallback organizer.
  • To override the organizer for a specific meeting request, include the organizadorEmail field in the POST /api/meetings request body. If provided, it takes precedence over the environment variable.
DEFAULT_ORGANIZER_EMAIL=consultant@yourcompany.com

Timezone

All meeting times are created in the America/Bogota timezone (UTC-5), which corresponds to Colombian Standard Time. This timezone does not observe daylight saving time. If your consultants operate from a different region, update the timeZone field in both the start and end objects inside the createTeamsMeeting function in /app/api/meetings/route.ts.

Attendees

Every email address in the asistentes array receives a calendar invite from Microsoft with the Teams join link embedded. Key details about attendee behavior:
  • Attendees are added with type: 'required' — they receive an invitation and their accept/decline response is tracked.
  • Attendees do not need a Teams account to join. The join URL opens the Teams web app in any modern browser.
  • All attendees see Oficina Virtual GCS - {sala} as the meeting location in their calendar invite.
Test meeting creation by sending a POST to /api/meetings with a future fecha value. Include at least one attendee with a valid email. In development mode (no Azure credentials configured), the route returns a mock response with id: 'dev-{timestamp}' and joinUrl: null — no real Teams event is created.

Build docs developers (and LLMs) love