編輯

共用方式為


Get primaryChannel

Namespace: microsoft.graph

Get the default channel, General, of a team.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

This API supports admin permissions. Users with admin roles can access teams that they aren't members of.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Channel.ReadBasic.All ChannelSettings.Read.All, ChannelSettings.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application ChannelSettings.Read.Group Channel.ReadBasic.All, ChannelSettings.Read.All, ChannelSettings.ReadWrite.All, ChannelSettings.ReadWrite.Group

Note

The ChannelSettings.Read.Group and ChannelSettings.ReadWrite.Group permissions use resource-specific consent.

HTTP request

GET /teams/{id}/primaryChannel

Optional query parameters

This method supports the $filter, $select, and $expand OData query parameters to help customize the response.

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a channel object in the response body.

Example

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/teams/02bd9fd6-8f93-4758-87c3-1fb73740a315/primaryChannel

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('32e3b156-66b2-4135-9aeb-73295a35a55b')/primaryChannel/$entity",
    "id": "19:skypespaces_dd1e128ffa85453ab1f3015468e979d5@thread.skype",
    "displayName": "General",
    "description": "Microsoft Teams Platform team discussions",
    "email": "0686dc7a.microsoft.com@amer.teams.ms",
    "webUrl": "https://teams.microsoft.com/l/channel/19%3askypespaces_dd1e128ffa85453ab1f3015468e979d5%40thread.skype/General?groupId=32e3b156-66b2-4135-9aeb-73295a35a55b&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47"
}