I need to get meeting participants and their e-mail addresses. My application has permissions:
- OnlineMeeting.ReadBasic.Chat
- OnlineMeetingParticipant.Read.Chat
But GetParticipantsAsync method always throws with 404 Http status code.
Here is my code
[Conversation.MembersAdded]
public async Task OnMembersAdded(IContext<ConversationUpdateActivity> context)
{
string? teamsMeetingId = context.Activity.GetMeetingId();
var members = await context.Api.Conversations.Members.GetAsync(context.Activity.Conversation.Id);
foreach (var member in members)
{
var participant = await context.Api.Meetings.GetParticipantAsync(teamsMeetingId, member.Id);
}
}
and GetMeetingId extension method is just:
public static string? GetMeetingId(this IActivity activity)
{
if (activity.ChannelData?.Properties != null && activity.ChannelData.Properties.TryGetValue("meeting", out var meetingNode))
{
if (meetingNode is JsonElement jel)
{
try
{
var meetingData = jel.Deserialize<Meeting>(new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
return meetingData?.Id;
}
catch (Exception)
{
// Log error if necessary
}
}
}
return null;
}
TeamsMeetingId now is the meetingId in base64 form. But I tried also context.Activity.Conversation.Id.
Steps:
- Create a meeting in Teams
- Start the meeting
- Add application to the meeting -> then my code is executed.
I tried also:
- Create a meeting in Teams
- Edit the meeting
- Add application to the meeting -> then my code is executed
But each of these steps give the same result - 404 NotFound.
This is real blocker for me.
I need to get meeting participants and their e-mail addresses. My application has permissions:
But
GetParticipantsAsyncmethod always throws with 404 Http status code.Here is my code
and
GetMeetingIdextension method is just:TeamsMeetingId now is the meetingId in base64 form. But I tried also
context.Activity.Conversation.Id.Steps:
I tried also:
But each of these steps give the same result - 404 NotFound.
This is real blocker for me.