Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren sie die Eigenschaften eines educationAssignmentDefaults-Objekts . Nur Lehrkräfte können diese Einstellungen aktualisieren.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
EduAssignments.ReadWriteBasic |
EduAssignments.ReadWrite |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Nicht unterstützt |
Nicht unterstützt |
HTTP-Anforderung
PATCH /education/classes/{id}/assignmentDefaults
Anforderungstext
Geben Sie im Anforderungstext nur die Werte für zu aktualisierende Eigenschaften an. Vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, behalten ihre vorherigen Werte bei oder werden basierend auf Änderungen an anderen Eigenschaftswerten neu berechnet.
In der folgenden Tabelle sind die Eigenschaften angegeben, die aktualisiert werden können.
| Eigenschaft |
Typ |
Beschreibung |
| addedStudentAction |
educationAddedStudentAction |
Standardverhalten auf Klassenebene für den Umgang mit Kursteilnehmern, die nach der Veröffentlichung der Aufgabe hinzugefügt werden. Die möglichen Werte sind: none, assignIfOpen. Der Standardwert ist none. |
| dueTime |
TimeOfDay |
Standardwert auf Klassenebene für das Feld "Fällige Zeit". Der Standardwert ist 23:59:00 |
| notificationChannelUrl |
Zeichenfolge |
Teams-Standardkanal, an den Benachrichtigungen gesendet werden. Der Standardwert ist null. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode einen 200 OK Antwortcode und ein aktualisiertes educationAssignmentDefaults-Objekt im Antworttext zurück.
Beispiele
Anforderung
PATCH https://graph.microsoft.com/beta/education/classes/{id}/assignmentDefaults
Content-Type: application/json
{
"addedStudentAction": "assignIfOpen",
"addToCalendarAction": "studentsAndTeamOwners",
"notificationChannelUrl": "https://graph.microsoft.com/beta/teams('id')/channels('id')"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new EducationAssignmentDefaults
{
AddedStudentAction = EducationAddedStudentAction.AssignIfOpen,
AddToCalendarAction = EducationAddToCalendarOptions.StudentsAndTeamOwners,
NotificationChannelUrl = "https://graph.microsoft.com/beta/teams('id')/channels('id')",
};
// 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}"].AssignmentDefaults.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationAssignmentDefaults()
addedStudentAction := graphmodels.ASSIGNIFOPEN_EDUCATIONADDEDSTUDENTACTION
requestBody.SetAddedStudentAction(&addedStudentAction)
addToCalendarAction := graphmodels.STUDENTSANDTEAMOWNERS_EDUCATIONADDTOCALENDAROPTIONS
requestBody.SetAddToCalendarAction(&addToCalendarAction)
notificationChannelUrl := "https://graph.microsoft.com/beta/teams('id')/channels('id')"
requestBody.SetNotificationChannelUrl(¬ificationChannelUrl)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignmentDefaults, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").AssignmentDefaults().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationAssignmentDefaults educationAssignmentDefaults = new EducationAssignmentDefaults();
educationAssignmentDefaults.setAddedStudentAction(EducationAddedStudentAction.AssignIfOpen);
educationAssignmentDefaults.setAddToCalendarAction(EducationAddToCalendarOptions.StudentsAndTeamOwners);
educationAssignmentDefaults.setNotificationChannelUrl("https://graph.microsoft.com/beta/teams('id')/channels('id')");
EducationAssignmentDefaults result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignmentDefaults().patch(educationAssignmentDefaults);
const options = {
authProvider,
};
const client = Client.init(options);
const educationAssignmentDefaults = {
addedStudentAction: 'assignIfOpen',
addToCalendarAction: 'studentsAndTeamOwners',
notificationChannelUrl: 'https://graph.microsoft.com/beta/teams(\'id\')/channels(\'id\')'
};
await client.api('/education/classes/{id}/assignmentDefaults')
.version('beta')
.update(educationAssignmentDefaults);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\EducationAssignmentDefaults;
use Microsoft\Graph\Beta\Generated\Models\EducationAddedStudentAction;
use Microsoft\Graph\Beta\Generated\Models\EducationAddToCalendarOptions;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationAssignmentDefaults();
$requestBody->setAddedStudentAction(new EducationAddedStudentAction('assignIfOpen'));
$requestBody->setAddToCalendarAction(new EducationAddToCalendarOptions('studentsAndTeamOwners'));
$requestBody->setNotificationChannelUrl('https://graph.microsoft.com/beta/teams(\'id\')/channels(\'id\')');
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignmentDefaults()->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Education
$params = @{
addedStudentAction = "assignIfOpen"
addToCalendarAction = "studentsAndTeamOwners"
notificationChannelUrl = "https://graph.microsoft.com/beta/teams('id')/channels('id')"
}
Update-MgBetaEducationClassAssignmentDefault -EducationClassId $educationClassId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.education_assignment_defaults import EducationAssignmentDefaults
from msgraph_beta.generated.models.education_added_student_action import EducationAddedStudentAction
from msgraph_beta.generated.models.education_add_to_calendar_options import EducationAddToCalendarOptions
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EducationAssignmentDefaults(
added_student_action = EducationAddedStudentAction.AssignIfOpen,
add_to_calendar_action = EducationAddToCalendarOptions.StudentsAndTeamOwners,
notification_channel_url = "https://graph.microsoft.com/beta/teams('id')/channels('id')",
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignment_defaults.patch(request_body)
Antwort
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"addedStudentAction": "assignIfOpen",
"addToCalendarAction": "studentsAndTeamOwners",
"dueTime": "2021-08-30T23:59:00Z",
"notificationChannelUrl": "https://graph.microsoft.com/beta/teams('id')/channels('id')"
}
Verwandte Inhalte