To retrieve Teams meeting metadata and participant logs, you can utilize the Microsoft Teams JavaScript client library (TeamsJS) and the Microsoft Bot Framework SDK. Here’s how you can achieve your goals:
- Meeting Metadata:
- You can use the Get meeting details API to retrieve the meeting ID, title, and join URL. This API allows you to get information about the meeting directly from the Teams context.
- Example code to get meeting details:
const meetingDetails = await TeamsInfo.getMeetingInfo(context); console.log(meetingDetails); - The
meetingDetailsobject will contain properties such asdetails.id,details.title, anddetails.joinUrl.
- Organizer ID:
- The organizer's ID can also be retrieved from the meeting details using the same API. Look for the
organizer.idproperty in the response.
- The organizer's ID can also be retrieved from the meeting details using the same API. Look for the
- Participant List and Timestamps:
- For participant information, you can use the Get participant API. This API allows you to fetch participant details by meeting ID and participant ID.
- Example code to get participant information:
const participantInfo = await TeamsInfo.getMeetingParticipant(context, participantId); console.log(participantInfo); - Note that you will need to handle the join and leave timestamps separately, as this information may not be directly available through the SDK.
Graph API Usage:
If you find that you need to use the Graph API for additional functionality, you can follow these steps:
- Mapping SDK Context to Graph ID: The
context.meeting.idcan be used to retrieve the corresponding Graph-compatible ID by making a call to the Graph API endpoint for meetings. - Retrieving Additional Information: You can use the Graph API to get the
joinWebUrl,organizer.id, and participant logs by querying the relevant endpoints.
Best Practices:
- Keep your app's logic modular to handle both SDK and Graph API calls effectively.
- Ensure that you manage permissions properly to access meeting and participant information.
By using the TeamsJS library along with the Bot Framework SDK, you can minimize backend complexity and keep most of your logic within the Teams meeting tab.
References: