Fetch Event Content
Retrieves the body content of a calendar event from Outlook/Microsoft 365. This action fetches the detailed description and notes associated with a calendar event.
Overview
- Purpose: Get the detailed body content of a specific calendar event.
- Use Cases: Reading event descriptions, extracting meeting notes, displaying event details, syncing event content, automated event processing.
- API Method: GET /fetch-attachment
- Microsoft Graph API: Uses Microsoft Graph
/v1.0/me/events/\{eventId\}endpoint with $select=body parameter. - Required Scope:
Mail.Read
Required Input Fields
Event ID: The unique identifier of the calendar event. This is the event ID from Microsoft Graph.
Getting Event IDs
- Events Sync: Use the ‘events’ sync to retrieve calendar events with their IDs.
- Event Metadata: The sync provides event IDs along with basic event information.
- Workflow: First sync events, then use event IDs to fetch detailed body content.
- Selective Fetching: Only fetch body content when needed to reduce API calls.
Output
- Content: The body text of the event (description, notes, agenda, etc.).
- Content Type: Indicates whether the content is plain text or HTML.
- Format: Returns an object with ‘content’ (string) and ‘contentType’ (‘text’ or ‘html’) properties.
Content Types
- Text: Plain text content without formatting.
- HTML: Rich HTML content with formatting, links, and styling.
- Processing: Handle HTML content appropriately - sanitize if displaying in UI, parse if extracting data.
- Rendering: Use the contentType to determine how to display or process the content.
Required Permissions
[!IMPORTANT] OAuth Scope: Requires
Mail.Readscope (note: despite the name, this works for calendar events).
- Read-Only: This scope allows reading calendar events but not creating or modifying them.
- User Consent: Users must grant permission to read their calendar during OAuth flow.
- Scope Note: The Mail.Read scope provides access to both mail and calendar data in Outlook.
Error Handling
- Missing ID: Throws an error if the event ID is not provided in the input.
- Invalid ID: Returns an error if the event ID doesn’t exist or has been deleted.
- Permissions: Fails if the user hasn’t granted the required scope.
- Retry Logic: Automatically retries failed requests up to 3 times.
Use Cases
- Meeting Notes: Extract meeting agendas and notes from event descriptions.
- Event Details: Display full event descriptions in custom calendar interfaces.
- Content Search: Search through event body content for specific information.
- Automated Processing: Extract action items, links, or structured data from event descriptions.
- Reporting: Generate reports including event descriptions and details.
- Sync to External Systems: Sync event content to project management or CRM systems.
Tips
[!TIP] First sync events to get event IDs before fetching content
[!TIP] Check contentType to determine if content is text or HTML
[!WARNING] Sanitize HTML content before displaying in UI to prevent XSS attacks
[!TIP] Only fetch event content when needed - the events sync provides basic info
[!TIP] Cache event content to reduce API calls for frequently accessed events
[!TIP] Handle empty or null content gracefully - not all events have descriptions
[!TIP] Use the $select parameter approach to fetch only the data you need
[!TIP] Consider fetching content in batches for multiple events to optimize performance
[!IMPORTANT] Ensure your OAuth flow requests the Mail.Read scope
[!TIP] Test with both text and HTML content types to ensure proper handling
[!TIP] For HTML content, consider using a library to parse and extract text if needed
[!TIP] Store event IDs for quick content retrieval without re-syncing all events