Skip to content

Commit 74e4bd1

Browse files
committed
Update get-teams-context.md
1 parent b476d30 commit 74e4bd1

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

msteams-platform/bots/how-to/get-teams-context.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ description: Get Teams specific context for your bot, fetch user profile, get si
44
ms.topic: conceptual
55
ms.localizationpriority: high
66
ms.owner: angovil
7-
ms.date: 03/25/2026
7+
ms.date: 03/30/2026
88
---
99
# Get Teams specific context for your bot
1010

1111
A bot can access additional context data about a team or chat where it's installed. This information can be used to enrich the bot's functionality and provide a more personalized experience.
1212

1313
## Fetch the roster or user profile
1414

15-
Your bot can query for the list of members and their basic user profiles, including Teams user IDs and Microsoft Entra information, such as name and objectId. You can use this information to correlate user identities. For example, to check whether a user logged into a tab through Microsoft Entra credentials is a member of the team. For get conversation members, minimum or maximum page size depends on the implementation. Page size less than 50, are treated as 50, and greater than 500, are capped at 500. Even if you use the non-paged version, it's unreliable in large teams and must not be used. For more information, see [changes to Teams Bot APIs for fetching team or chat members](~/resources/team-chat-member-api-changes.md).
15+
Your bot can query for the list of members and their basic user profiles, including Teams user IDs and Microsoft Entra information, such as name and objectId. You can use this information to correlate user identities. For example, to check whether a user logged into a tab through Microsoft Entra credentials is a member of the team. For get conversation members, minimum or maximum page size depends on the implementation. Page size less than 50, are treated as 50, and greater than 500, are capped at 500. Even if you use the non-paged version, it's unreliable in large teams and must not be used.
1616

1717
> [!NOTE]
1818
>
@@ -23,8 +23,6 @@ The following sample code uses the paged endpoint for fetching the roster:
2323

2424
# [C#](#tab/dotnet)
2525

26-
* [SDK reference](/dotnet/api/microsoft.bot.builder.teams.teamsinfo.getpagedmembersasync?view=botbuilder-dotnet-stable&preserve-view=true)
27-
2826
```csharp
2927
app.OnMessage(async context =>
3028
{
@@ -37,8 +35,6 @@ app.OnMessage(async context =>
3735

3836
# [TypeScript](#tab/typescript)
3937

40-
* [SDK reference](/javascript/api/botbuilder/teamsinfo?view=botbuilder-ts-latest&preserve-view=true#botbuilder-teamsinfo-getpagedmembers)
41-
4238
```typescript
4339
app.on('message', async ({ activity, api }) => {
4440
const conversationId = activity.conversation.id;
@@ -50,8 +46,6 @@ app.on('message', async ({ activity, api }) => {
5046

5147
# [Python](#tab/python)
5248

53-
[SDK reference](/python/api/botbuilder-core/botbuilder.core.teams.teamsinfo?view=botbuilder-py-latest&preserve-view=true#botbuilder-core-teams-teamsinfo-get-team-members)
54-
5549
```python
5650
@app.on_message
5751
async def handle_message(ctx: ActivityContext[MessageActivity]):
@@ -114,8 +108,6 @@ The following sample code is used to get single member details:
114108

115109
# [C#](#tab/dotnet)
116110

117-
* [SDK reference](/dotnet/api/microsoft.bot.builder.teams.teamsinfo.getmemberasync?view=botbuilder-dotnet-stable&preserve-view=true)
118-
119111
```csharp
120112
app.OnMessage(async context =>
121113
{
@@ -129,8 +121,6 @@ app.OnMessage(async context =>
129121

130122
# [TypeScript](#tab/typescript)
131123

132-
* [SDK reference](/javascript/api/botbuilder/teamsinfo?view=botbuilder-ts-latest&preserve-view=true#botbuilder-teamsinfo-getmember)
133-
134124
```typescript
135125
app.on('message', async ({ activity, api }) => {
136126
const conversationId = activity.conversation.id;
@@ -143,8 +133,6 @@ app.on('message', async ({ activity, api }) => {
143133

144134
# [Python](#tab/python)
145135

146-
* [SDK reference](/python/api/botbuilder-core/botbuilder.core.teams.teamsinfo?view=botbuilder-py-latest&preserve-view=true#botbuilder-core-teams-teamsinfo-get-member)
147-
148136
```python
149137
@app.on_message
150138
async def handle_message(ctx: ActivityContext[MessageActivity]):
@@ -203,8 +191,6 @@ The following sample code is used to get team's details:
203191

204192
# [C#](#tab/dotnet)
205193

206-
* [SDK reference](/dotnet/api/microsoft.bot.builder.teams.teamsinfo.getteamdetailsasync?view=botbuilder-dotnet-stable&preserve-view=true)
207-
208194
```csharp
209195
app.OnMessage(async context =>
210196
{
@@ -225,8 +211,6 @@ app.OnMessage(async context =>
225211

226212
# [TypeScript](#tab/typescript)
227213

228-
* [SDK reference](/javascript/api/botbuilder/teamsinfo?view=botbuilder-ts-latest&preserve-view=true#botbuilder-teamsinfo-getteamdetails)
229-
230214
```typescript
231215
app.on('message', async ({ activity, api, send }) => {
232216
const teamId = activity.channelData?.team?.id;
@@ -243,8 +227,6 @@ app.on('message', async ({ activity, api, send }) => {
243227

244228
# [Python](#tab/python)
245229

246-
[SDK reference](/python/api/botbuilder-core/botbuilder.core.teams.teamsinfo?view=botbuilder-py-latest&preserve-view=true#botbuilder-core-teams-teamsinfo-get-team-details)
247-
248230
```python
249231
@app.on_message
250232
async def handle_message(ctx: ActivityContext[MessageActivity]):
@@ -290,8 +272,6 @@ The following sample code is used to get the list of channels in a team:
290272

291273
# [C#](#tab/dotnet)
292274

293-
* [SDK reference](/dotnet/api/microsoft.bot.builder.teams.teamsinfo.getteamchannelsasync?view=botbuilder-dotnet-stable&preserve-view=true)
294-
295275
```csharp
296276
app.OnMessage(async context =>
297277
{
@@ -308,8 +288,6 @@ app.OnMessage(async context =>
308288

309289
# [TypeScript](#tab/typescript)
310290

311-
[SDK reference](/javascript/api/botbuilder/teamsinfo?view=botbuilder-ts-latest&preserve-view=true#botbuilder-teamsinfo-getteamchannels)
312-
313291
```typescript
314292
app.on('message', async ({ activity, api, send }) => {
315293
const teamId = activity.channelData?.team?.id;
@@ -324,8 +302,6 @@ app.on('message', async ({ activity, api, send }) => {
324302

325303
# [Python](#tab/python)
326304

327-
[SDK reference](/python/api/botbuilder-core/botbuilder.core.teams.teamsinfo?view=botbuilder-py-latest&preserve-view=true#botbuilder-core-teams-teamsinfo-get-team-channels)
328-
329305
```python
330306
@app.on_message
331307
async def handle_message(ctx: ActivityContext[MessageActivity]):

0 commit comments

Comments
 (0)