Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(KNO-7618): add MS Teams teams and channels API endpoints #756

Merged
merged 6 commits into from
Jan 28, 2025
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
195 changes: 195 additions & 0 deletions content/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6650,6 +6650,8 @@ Revoke an access token from Slack and remove it from the access token object.
<ExampleColumn>
<Endpoints>
<Endpoint name="ms-teams-auth-check" method="GET" path="/providers/ms-teams/:channel_id/auth_check" withLink/>
<Endpoint name="ms-teams-teams" method="GET" path="/providers/ms-teams/:channel_id/teams" withLink/>
<Endpoint name="ms-teams-channels" method="GET" path="/providers/ms-teams/:channel_id/channels" withLink/>
<Endpoint name="ms-teams-revoke-access" method="PUT" path="/providers/ms-teams/:channel_id/revoke_access" withLink/>
</Endpoints>
</ExampleColumn>
Expand Down Expand Up @@ -6738,6 +6740,199 @@ Revoke an access token from Slack and remove it from the access token object.
</ExampleColumn>
</Section>

<Section title="Microsoft Teams teams" slug="ms-teams-teams">
<ContentColumn>
Get a list of teams belonging to the Microsoft Entra tenant.

### Endpoint

<Endpoint
name="teams"
method="GET"
path="/providers/ms-teams/:channel_id/teams"
/>

### Rate limit

<RateLimit tier={2} />

### Path parameters

<Attributes>
<Attribute
name="channel_id"
type="string"
description="The Knock Microsoft Teams channel ID"
/>
</Attributes>

### Query parameters

<Attributes>
<Attribute
name="ms_teams_tenant_object[object_id]"
type="string"
description="ID of the Object or Tenant."
/>
<Attribute
name="ms_teams_tenant_object[collection]"
type="string"
description="Collection of the Object or Tenant. If Tenant, should be `$tenants`."
/>
<Attribute
name="query_options[:option]"
type="string"
description={
<>
An optional query option passed to the Microsoft Graph API. One of{" "}
<code>$filter</code>, <code>$select</code>, <code>$top</code>,{" "}
<code>$skiptoken</code>. See the{" "}
<a
href="https://learn.microsoft.com/en-us/graph/api/teams-list#optional-query-parameters"
target="_blank"
>
Microsoft Graph API documentation
</a>{" "}
for more information.
</>
}
/>
</Attributes>

### Returns

- `200` List of teams in the Microsoft Entra tenant.
- `403` When no Microsoft Entra tenant ID is set for the given object.

</ContentColumn>
<ExampleColumn>

```json
// Success response

{
"ms_teams_teams": [
{
"id": "team-id-1",
"displayName": "Engineering Team"
}
],
"skip_token": "token-for-next-page"
}
```

```json
// Missing Microsoft Entra tenant ID error response

{
"code": "authorization",
"message": "Microsoft Teams tenant ID not set.",
"status": 403,
"type": "authentication_error"
}
```

</ExampleColumn>
</Section>

<Section title="Microsoft Teams channels" slug="ms-teams-channels">
<ContentColumn>
Get a list of the Microsoft Teams channels within a team. By default, archived and private channels are excluded from the results.

### Endpoint

<Endpoint
name="channels"
method="GET"
path="/providers/ms-teams/:channel_id/channels"
/>

### Rate limit

<RateLimit tier={2} />

### Path parameters

<Attributes>
<Attribute
name="channel_id"
type="string"
description="The Knock Microsoft Teams channel ID"
/>
</Attributes>

### Query parameters

<Attributes>
<Attribute
name="ms_teams_tenant_object[object_id]"
type="string"
description="ID of the Object or Tenant."
/>
<Attribute
name="ms_teams_tenant_object[collection]"
type="string"
description="Collection of the Object or Tenant. If Tenant, should be `$tenants`."
/>
<Attribute
name="team_id"
type="string"
description="The ID of the Microsoft Teams team to list channels from."
/>
<Attribute
name="query_options[:option]"
type="string"
description={
<>
An optional query option passed to the Microsoft Graph API. One of{" "}
<code>$filter</code>, <code>$select</code>. See the{" "}
<a
href="https://learn.microsoft.com/en-us/graph/api/channel-list#optional-query-parameters"
target="_blank"
>
Microsoft Graph API documentation
</a>{" "}
for more information.
</>
}
/>
</Attributes>

### Returns

- `200` List of Microsoft Teams channels in the specified team.
- `403` When no Microsoft Entra tenant ID is set for the given object.

</ContentColumn>
<ExampleColumn>

```json
// Success response

{
"ms_teams_channels": [
{
"id": "channel-id-1",
"displayName": "General"
}
]
}
```

```json
// Missing Microsoft Entra tenant ID error response

{
"code": "authorization",
"message": "Microsoft Teams tenant ID not set.",
"status": 403,
"type": "authentication_error"
}
```

</ExampleColumn>
</Section>

<Section title="Microsoft Teams revoke access" slug="ms-teams-revoke-access">
<ContentColumn>
Removes a Microsoft Entra tenant ID from the Microsoft Teams tenant object.
Expand Down
2 changes: 2 additions & 0 deletions data/apiReferenceSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ const sidebarContent: SidebarSection[] = [
pages: [
{ slug: "#ms-teams", title: "Overview" },
{ slug: "#ms-teams-auth-check", title: "Auth check" },
{ slug: "#ms-teams-teams", title: "Teams" },
{ slug: "#ms-teams-channels", title: "Channels" },
{ slug: "#ms-teams-revoke-access", title: "Revoke access" },
],
},
Expand Down
Loading