列出 assignmentCategories
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph /beta
版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
检索 educationCategory 对象的列表。 只有教师才能执行此操作。
此 API 可用于以下国家级云部署 。
全局服务
美国政府 L4
美国政府 L5 (DOD)
由世纪互联运营的中国
✅
❌
❌
❌
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时 ,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型 。 要了解有关这些权限的详细信息,请参阅 权限参考 。
权限类型
最低特权权限
更高特权权限
委派(工作或学校帐户)
EduAssignments.ReadBasic
EduAssignments.Read、EduAssignments.ReadWrite、EduAssignments.ReadWriteBasic
委派(个人 Microsoft 帐户)
不支持。
不支持。
应用程序
EduAssignments.ReadBasic.All
EduAssignments.Read.All、EduAssignments.ReadWrite.All、EduAssignments.ReadWriteBasic.All
HTTP 请求
GET /education/classes/{id}/assignmentCategories
可选的查询参数
此方法支持使用 OData 查询参数 来帮助自定义响应。
查询参数 $filter
和 $orderby
支持所有属性 。
标头
值
Authorization
持有者 {token}。 必填。 详细了解 身份验证和授权 。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回响应 200 OK
代码和 educationCategory 对象集合。
示例
示例 1:获取分配类别
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/beta/education/classes/4797d052-ebf5-4018-a088-e11adc6b2cbb/assignmentCategories
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes["{educationClass-id}"].AssignmentCategories.GetAsync();
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta education classes assignment-categories list --education-class-id {educationClass-id}
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
assignmentCategories, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentCategories().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationCategoryCollectionResponse result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignmentCategories().get();
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/4797d052-ebf5-4018-a088-e11adc6b2cbb/assignmentCategories')
.version('beta')
.get();
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentCategories()->get()->wait();
Import-Module Microsoft.Graph.Beta.Education
Get-MgBetaEducationClassAssignmentCategory -EducationClassId $educationClassId
from msgraph import GraphServiceClient
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_categories.get()
响应
以下示例显示了相应的响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/education/classes('4797d052-ebf5-4018-a088-e11adc6b2cbb')/assignmentCategories",
"value": [
{
"displayName": "Quizzes",
"id": "f997a279-6bcf-429e-b1d0-d2320c4b84ab"
},
{
"displayName": "Homework",
"id": "9b8f8f88-ddfc-4aad-9fe9-280513fffc74"
}
]
}
示例 2:使用 $filter
获取分配类别
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/beta/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories?$filter=id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes["{educationClass-id}"].AssignmentCategories.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'";
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta education classes assignment-categories list --education-class-id {educationClass-id} --filter "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'"
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
grapheducation "github.com/microsoftgraph/msgraph-beta-sdk-go/education"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestFilter := "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'"
requestParameters := &grapheducation.EducationClasseItemAssignmentCategoriesRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &grapheducation.EducationClasseItemAssignmentCategoriesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
assignmentCategories, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentCategories().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationCategoryCollectionResponse result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignmentCategories().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'";
});
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories')
.version('beta')
.filter('id eq \'d4cb4f68-9136-48d3-9054-c1208ea274f0\'')
.get();
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Education\Classes\Item\AssignmentCategories\AssignmentCategoriesRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AssignmentCategoriesRequestBuilderGetRequestConfiguration();
$queryParameters = AssignmentCategoriesRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentCategories()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Education
Get-MgBetaEducationClassAssignmentCategory -EducationClassId $educationClassId -Filter "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'"
from msgraph import GraphServiceClient
from msgraph.generated.education.classes.item.assignmentCategories.assignment_categories_request_builder import AssignmentCategoriesRequestBuilder
graph_client = GraphServiceClient(credentials, scopes)
query_params = AssignmentCategoriesRequestBuilder.AssignmentCategoriesRequestBuilderGetQueryParameters(
filter = "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'",
)
request_configuration = AssignmentCategoriesRequestBuilder.AssignmentCategoriesRequestBuilderGetRequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_categories.get(request_configuration = request_configuration)
响应
以下示例显示了相应的响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('2003c52e-807a-4186-9b49-60c573095461')/assignmentCategories",
"value": [
{
"displayName": "2022-11-09T20_16_24_105Z",
"id": "d4cb4f68-9136-48d3-9054-c1208ea274f0"
}
]
}
示例 3:使用 $orderby
获取分配类别
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/beta/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories?$orderby=displayName
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes["{educationClass-id}"].AssignmentCategories.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Orderby = new string []{ "displayName" };
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta education classes assignment-categories list --education-class-id {educationClass-id} --orderby "displayName"
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
grapheducation "github.com/microsoftgraph/msgraph-beta-sdk-go/education"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestParameters := &grapheducation.EducationClasseItemAssignmentCategoriesRequestBuilderGetQueryParameters{
Orderby: [] string {"displayName"},
}
configuration := &grapheducation.EducationClasseItemAssignmentCategoriesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
assignmentCategories, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentCategories().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationCategoryCollectionResponse result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignmentCategories().get(requestConfiguration -> {
requestConfiguration.queryParameters.orderby = new String []{"displayName"};
});
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories')
.version('beta')
.orderby('displayName')
.get();
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Education\Classes\Item\AssignmentCategories\AssignmentCategoriesRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AssignmentCategoriesRequestBuilderGetRequestConfiguration();
$queryParameters = AssignmentCategoriesRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->orderby = ["displayName"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentCategories()->get($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Education
Get-MgBetaEducationClassAssignmentCategory -EducationClassId $educationClassId -Sort "displayName"
from msgraph import GraphServiceClient
from msgraph.generated.education.classes.item.assignmentCategories.assignment_categories_request_builder import AssignmentCategoriesRequestBuilder
graph_client = GraphServiceClient(credentials, scopes)
query_params = AssignmentCategoriesRequestBuilder.AssignmentCategoriesRequestBuilderGetQueryParameters(
orderby = ["displayName"],
)
request_configuration = AssignmentCategoriesRequestBuilder.AssignmentCategoriesRequestBuilderGetRequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_categories.get(request_configuration = request_configuration)
响应
以下示例显示了相应的响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('2003c52e-807a-4186-9b49-60c573095461')/assignmentCategories",
"@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories?$orderby=displayName&$skiptoken=MyZRVkZCUVVGQlFVRk5aelJCUVVGQlFVRkJRWGxCUVVGQlIyZE1VMjFyVFVrMk1HbFNablZPTXpkdVRpOVlkejA5",
"value": [
{
"displayName": "2019-04-05T21_30_03_125Z",
"id": "0c3c2de5-d317-42b9-a4a7-dede7a87f6df"
},
{
"displayName": "2019-04-05T21_30_21'941Z",
"id": "ec2a0bfe-f7c5-4a33-a5ea-58db087cb1c7"
},
{
"displayName": "2019-04-17T18_46_15_996Z",
"id": "5d4458a4-0784-491b-b4eb-643daf3408d0"
},
{
"displayName": "2019-04-22T22_01_29_919Z",
"id": "012c321e-70af-4b56-8949-1d228cbbdf35"
},
{
"displayName": "2019-04-23T02_04_51_925Z",
"id": "72fc6ce0-af91-4eaf-b675-b979aa7540c2"
},
{
"displayName": "2019-04-24T18_24_54_540Z",
"id": "3c8b14c1-a118-44fb-a308-8175f3dec179"
},
{
"displayName": "2019-04-24T18_25_05_792Z",
"id": "328b7715-86d4-4580-aae7-3dc80f570b49"
},
{
"displayName": "2019-05-16T23_19_05_865Z",
"id": "c71c2e76-4af4-4794-a6eb-fe86d30d9209"
},
{
"displayName": "2019-05-16T23_19_06_340Z",
"id": "29d62f01-1d70-447f-8c03-2ef19d3911f6"
},
{
"displayName": "2019-05-16T23_19_06'504Z",
"id": "63219333-859a-45f0-9003-bc1512b8c6a5"
}
]
}