APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new LearningCourseActivity
{
OdataType = "#microsoft.graph.learningAssignment",
CompletedDateTime = null,
CompletionPercentage = 20,
ExternalCourseActivityId = "12a2228a-e020-11ec-9d64-0242ac120002",
LearningContentId = "57baf9dc-e020-11ec-9d64-0242ac120002",
LearningProviderId = "01e8f81b-3060-4dec-acf0-0389665a0a38",
LearnerUserId = "7ba2228a-e020-11ec-9d64-0242ac120002",
Status = CourseStatus.NotStarted,
AdditionalData = new Dictionary<string, object>
{
{
"assignedDateTime" , "2021-05-11T22:57:17+00:00"
},
{
"assignmentType" , "required"
},
{
"assignerUserId" , "cea1684d-57dc-438d-a9d1-e666ec1a7f3d"
},
{
"dueDateTime" , new
{
DateTime = "2022-09-22T16:05:00.0000000",
TimeZone = "UTC",
}
},
{
"notes" , new
{
ContentType = "text",
Content = "required assignment added for user",
}
},
},
};
var result = await graphClient.EmployeeExperience.LearningProviders["{learningProvider-id}"].LearningCourseActivities.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new LearningCourseActivity();
$requestBody->set@odatatype('#microsoft.graph.learningAssignment');
$requestBody->setCompletedDateTime(null);
$requestBody->setCompletionPercentage(20);
$requestBody->setExternalCourseActivityId('12a2228a-e020-11ec-9d64-0242ac120002');
$requestBody->setLearningContentId('57baf9dc-e020-11ec-9d64-0242ac120002');
$requestBody->setLearningProviderId('01e8f81b-3060-4dec-acf0-0389665a0a38');
$requestBody->setLearnerUserId('7ba2228a-e020-11ec-9d64-0242ac120002');
$requestBody->setStatus(new CourseStatus('notstarted'));
$additionalData = [
'assignedDateTime' => '2021-05-11T22:57:17+00:00',
'assignmentType' => 'required',
'assignerUserId' => 'cea1684d-57dc-438d-a9d1-e666ec1a7f3d',
'dueDateTime' => $requestBody = new DueDateTime();
$ requestBody->setDateTime('2022-09-22T16:05:00.0000000');
$ requestBody->setTimeZone('UTC');
$requestBody->setDueDateTime($dueDateTime);
'notes' => $requestBody = new Notes();
$ requestBody->setContentType('text');
$ requestBody->setContent('required assignment added for user');
$requestBody->setNotes($notes);
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->employeeExperience()->learningProviders()->byLearningProviderId('learningProvider-id')->learningCourseActivities()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new LearningCourseActivity
{
OdataType = "#microsoft.graph.learningSelfInitiatedCourse",
CompletedDateTime = null,
CompletionPercentage = 20,
ExternalCourseActivityId = "12a2228a-e020-11ec-9d64-0242ac120002",
LearningContentId = "57baf9dc-e020-11ec-9d64-0242ac120002",
LearnerUserId = "7ba2228a-e020-11ec-9d64-0242ac120002",
Status = CourseStatus.InProgress,
AdditionalData = new Dictionary<string, object>
{
{
"startedDateTime" , "2021-05-21T22:57:17+00:00"
},
},
};
var result = await graphClient.EmployeeExperience.LearningProviders["{learningProvider-id}"].LearningCourseActivities.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new LearningCourseActivity();
$requestBody->set@odatatype('#microsoft.graph.learningSelfInitiatedCourse');
$requestBody->setCompletedDateTime(null);
$requestBody->setCompletionPercentage(20);
$requestBody->setExternalCourseActivityId('12a2228a-e020-11ec-9d64-0242ac120002');
$requestBody->setLearningContentId('57baf9dc-e020-11ec-9d64-0242ac120002');
$requestBody->setLearnerUserId('7ba2228a-e020-11ec-9d64-0242ac120002');
$requestBody->setStatus(new CourseStatus('inprogress'));
$additionalData = [
'startedDateTime' => '2021-05-21T22:57:17+00:00',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->employeeExperience()->learningProviders()->byLearningProviderId('learningProvider-id')->learningCourseActivities()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.