Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions teams.md/src/components/include/essentials/api/csharp.incl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| Area | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Conversations` | Gives your application the ability to perform activities on conversations (send, update, delete messages, etc.), or create conversations (like 1:1 chat with a user) |
| `Meetings` | Gives your application access to meeting details |
| `Meetings` | Gives your application access to meeting details and participant information via `GetByIdAsync` and `GetParticipantAsync` |
| `Teams` | Gives your application access to team or channel details |

<!-- api-object-description -->
Expand All @@ -28,8 +28,26 @@ app.OnMessage(async context =>
```


<!-- meetings-example -->

```csharp
app.OnMeetingStart(async context =>
{
var meetingId = context.Activity.Value.Id;
var tenantId = context.Activity.ChannelData?.Tenant?.Id;
var userId = context.Activity.From?.AadObjectId;

if (meetingId != null && tenantId != null && userId != null)
{
var participant = await context.Api.Meetings.GetParticipantAsync(meetingId, userId, tenantId);
// participant.Meeting?.Role — "Organizer", "Presenter", "Attendee"
// participant.Meeting?.InMeeting — true/false
}
});
```

<!-- proactive-example -->

```csharp
const members = await app.Api.Conversations.Members.Get("...");
var members = await app.Api.Conversations.Members.Get("...");
```
17 changes: 16 additions & 1 deletion teams.md/src/components/include/essentials/api/python.incl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| Area | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `conversations` | Gives your application the ability to perform activities on conversations (send, update, delete messages, etc.), or create conversations (like 1:1 chat with a user) |
| `meetings` | Gives your application access to meeting details |
| `meetings` | Gives your application access to meeting details and participant information via `get_by_id` and `get_participant` |
| `teams` | Gives your application access to team or channel details |

<!-- api-object-description -->
Expand All @@ -22,6 +22,21 @@ async def handle_message(ctx: ActivityContext[MessageActivity]):
members = await ctx.api.conversations.members.get(ctx.activity.conversation.id)
```

<!-- meetings-example -->

```python
@app.on_activity("meetingStart")
async def handle_meeting_start(ctx: ActivityContext):
meeting_id = ctx.activity.channel_data.meeting.id
tenant_id = ctx.activity.channel_data.tenant.id
user_id = ctx.activity.from_.aad_object_id

if meeting_id and tenant_id and user_id:
participant = await ctx.api.meetings.get_participant(meeting_id, user_id, tenant_id)
# participant.meeting.role — "Organizer", "Presenter", "Attendee"
# participant.meeting.in_meeting — True/False
```

<!-- proactive-example -->

```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| Area | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `conversations` | Gives your application the ability to perform activities on conversations (send, update, delete messages, etc.), or create conversations (like 1:1 chat with a user) |
| `meetings` | Gives your application access to meeting details |
| `meetings` | Gives your application access to meeting details and participant information via `getById` and `getParticipant` |
| `teams` | Gives your application access to team or channel details |

<!-- api-object-description -->
Expand All @@ -22,6 +22,22 @@ app.on('message', async ({ activity, api }) => {
});
```

<!-- meetings-example -->

```typescript
app.on('meetingStart', async ({ activity, api }) => {
const meetingId = activity.channelData?.meeting?.id;
const tenantId = activity.channelData?.tenant?.id;
const userId = activity.from?.aadObjectId;

if (meetingId && tenantId && userId) {
const participant = await api.meetings.getParticipant(meetingId, userId, tenantId);
// participant.meeting?.role — "Organizer", "Presenter", "Attendee"
// participant.meeting?.inMeeting — true/false
}
});
```

<!-- proactive-example -->

```typescript
Expand Down
14 changes: 14 additions & 0 deletions teams.md/src/pages/templates/essentials/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ In this example, we use the API client to fetch the members in a conversation. T
It's also possible to access the API client from outside a handler via the app instance. Here we have the same example as above, but we're access the API client via the app instance.

<LanguageInclude section="proactive-example" />


## Meetings Example

In this example, we use the API client to get a specific meeting participant's details, such as their role (e.g. Organizer) and whether they are currently in the meeting. Provide the user's AAD Object ID to specify which participant to look up. The `meetingId` and `tenantId` are available from the activity's channel data.

:::note
To retrieve **all** members of a meeting, use the conversations API as shown in the [example above](#example), since meetings are also conversations.
:::

<LanguageInclude section="meetings-example" />

Visit [Meeting Events](../in-depth-guides/meeting-events) to learn more about meeting events.