List assignmentCategories
Article
01/17/2024
12 contributors
Feedback
In this article
Namespace: microsoft.graph
Retrieve a list of educationCategory objects. Only teachers can perform this operation.
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 .
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
EduAssignments.ReadBasic
EduAssignments.Read, EduAssignments.ReadWrite, EduAssignments.ReadWriteBasic
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
EduAssignments.ReadBasic.All
EduAssignments.Read.All, EduAssignments.ReadWrite.All, EduAssignments.ReadWriteBasic.All
HTTP request
GET /education/classes/{id}/assignmentCategories
Optional query parameters
This method supports the $select
OData query parameters to help customize the response. For general information, see OData query parameters .
All properties are supported for the query parameters $filter
and $orderby
.
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of educationCategory objects in the response body.
Example
Example 1: Get assignment categories
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc education classes assignment-categories list --education-class-id {educationClass-id}
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
assignmentCategories, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentCategories().Get(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// 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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignmentCategories')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentCategories()->get()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
from msgraph import GraphServiceClient
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_categories.get()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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/education/classes('acdefc6b-2dc6-4e71-b1e9-6d9810ab1793')/assignmentCategories",
"value": [
{
"displayName": "Quizzes",
"id": "f997a279-6bcf-429e-b1d0-d2320c4b84ab"
},
{
"displayName": "Homework",
"id": "9b8f8f88-ddfc-4aad-9fe9-280513fffc74"
}
]
}
Example 2: Using $filter
to get assignment categories
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/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'";
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc education classes assignment-categories list --education-class-id {educationClass-id} --filter "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'"
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
grapheducation "github.com/microsoftgraph/msgraph-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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// 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'";
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories')
.filter('id eq \'d4cb4f68-9136-48d3-9054-c1208ea274f0\'')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Education
Get-MgEducationClassAssignmentCategory -EducationClassId $educationClassId -Filter "id eq 'd4cb4f68-9136-48d3-9054-c1208ea274f0'"
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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#education/classes('2003c52e-807a-4186-9b49-60c573095461')/assignmentCategories",
"value": [
{
"displayName": "2022-11-09T20_16_24_105Z",
"id": "d4cb4f68-9136-48d3-9054-c1208ea274f0"
}
]
}
Example 3: Using $orderby
to get assignment categories
Request
The following example shows a request.
GET https://graph.microsoft.com/v1.0/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" };
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc education classes assignment-categories list --education-class-id {educationClass-id} --orderby "displayName"
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
grapheducation "github.com/microsoftgraph/msgraph-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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// 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"};
});
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let assignmentCategories = await client.api('/education/classes/2003c52e-807a-4186-9b49-60c573095461/assignmentCategories')
.orderby('displayName')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Education
Get-MgEducationClassAssignmentCategory -EducationClassId $educationClassId -Sort "displayName"
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
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#education/classes('2003c52e-807a-4186-9b49-60c573095461')/assignmentCategories",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/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"
}
]
}