更新 learningContent

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

更新指定的 learningContent 资源。

学习提供程序用来引入或更新Viva Learning中内容的元数据。 如果指定提供程序的指定学习内容尚不存在,此操作会为新内容创建元数据。 否则,此操作将替换现有内容的元数据。

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) 不支持。 不支持。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 LearningContent.ReadWrite.All 不可用。

HTTP 请求

对于基于其 ID 的特定学习内容 (主键) :

PATCH /employeeExperience/learningProviders/{learningProviderId}/learningContents/{learningContentId}

对于基于其外部 ID 的特定学习内容 (辅助密钥) :

PATCH /employeeExperience/learningProviders/{learningProviderId}/learningContents(externalId='{externalId}') 

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
Content-Type application/json. 必需。

请求正文

在请求正文中,提供应更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者根据对其他属性值的更改重新计算。

下表指定可更新的属性。

属性 类型 说明
additionalTags 字符串集合 与学习内容关联的关键字、主题和其他标记。 可选。
contentWebUrl String 学习内容的内容 Web URL。 必填。
参与者 字符串集合 学习内容的作者、创建者或参与者。 可选。
createdDateTime DateTimeOffset 创建学习内容的日期和时间。 时间戳类型表示采用 ISO 8601 格式的日期和时间信息,始终采用 UTC 时区。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z。 可选。
说明 String 学习内容的说明或摘要。 可选。
duration 持续时间 学习内容的持续时间(以秒为单位)。 该值在持续时间内以 ISO 8601 格式表示。 可选。
externalId String 学习内容的唯一外部内容 ID。 必填。
format String 学习内容的格式。 例如, CourseVideoBookBook SummaryAudiobook Summary。 可选。
水平 级别 学习内容的难度级别。 可取值为:BeginnerIntermediateAdvanced。 可选。
isActive 布尔值 指示内容是否处于活动状态。 非活动内容不会显示在 UI 中。 默认值为 true。 可选。
isPremium 布尔值 指示学习内容是否要求用户在学习提供程序平台上登录。 默认值为 false。 可选。
isSearchable 布尔值 指示学习内容是否可搜索。 默认值为 true。 可选。
languageTag String 学习内容的语言,例如 en-usfr-fr。 必需。
lastModifiedDateTime DateTimeOffset 上次修改学习内容的日期和时间。 时间戳类型表示采用 ISO 8601 格式的日期和时间信息,始终采用 UTC 时区。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z。 可选。
numberOfPages Int32 学习内容的页数,例如 9。 可选。
skillTags 字符串集合 与学习内容关联的技能标记。 可选。
sourceName String 学习内容的源名称,例如 LinkedIn LearningCoursera。 可选。
thumbnailWebUrl String 学习内容缩略图图像的 URL。 可选。
title String 学习内容的标题。 必填。

响应

如果成功,此方法在响应正文中返回响应 202 Accepted 代码和更新的 learningContent 对象。

示例

示例 1:根据学习内容的 ID 更新其元数据

以下示例显示了一个请求,该请求根据学习内容的 ID (主键) 更新其元数据。

请求

下面为请求示例。

PATCH https://graph.microsoft.com/beta/employeeExperience/learningProviders/13727311-e7bb-470d-8b20-6a23d9030d70/learningContents/77029588-a660-46b6-ba58-3ce4d21d5678
Content-Type: application/json

{
    "title": "Manage classes, resources, assessment, and planning in Microsoft Teams with Beedle",
    "description": "A module to guide users through the various teaching and learning enhancements that Beedle provides within Microsoft Teams, with many examples of everyday application.",
    "contentWebUrl": "https://learn.microsoft.com/learn/modules/manage-classes-resources-assessment-planning-beedle/",
    "sourceName": "MsLearn",
    "thumbnailWebUrl": "https://syndetics.com/index.aspx?isbn=9783319672175/LC.GIF",
    "languageTag": "en-us",
    "numberOfPages": 9,
    "duration": "PT20M",
    "format": "Book",
    "level": "Beginner",
    "createdDateTime": "2018-01-01T00:00:00Z",
    "lastModifiedDateTime": "2021-04-01T04:26:06.1995367Z",
    "contributors": ["Scott Simpson"],
    "additionalTags": [
        "Create private or public teams",
        "Add members to teams"
    ],
    "skillTags": [
        "Create teams",
        "Teams channels",
        "Teams members"
    ],
    "isActive": true,
    "isPremium": false,
    "isSearchable": true
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 202 Accepted
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#learningProviders('13727311-e7bb-470d-8b20-6a23d9030d70')/learningContents/$entity",
    "id": "77029588-a660-46b6-ba58-3ce4d21d5678",
    "externalId": "LP4471",
    "title": "Manage classes, resources, assessment, and planning in Microsoft Teams with Beedle",
    "description": "A module to guide users through the various teaching and learning enhancements that Beedle provides within Microsoft Teams, with many examples of everyday application.",
    "contentWebUrl": "https://learn.microsoft.com/learn/modules/manage-classes-resources-assessment-planning-beedle/",
    "sourceName": "MsLearn",
    "thumbnailWebUrl": "https://syndetics.com/index.aspx?isbn=9783319672175/LC.GIF",
    "languageTag": "en-us",
    "numberOfPages": 9,
    "duration": "PT20M",
    "format": "Book",
    "level": "Beginner",
    "createdDateTime": "2018-01-01T00:00:00",
    "lastModifiedDateTime": "2021-04-01T04:26:06.1995367Z",
    "contributors": [
      "Lina Wagner",
      "Lisa Richter"
    ],
    "additionalTags": [
        "Create private or public teams",
        "Add members to teams"
    ],
    "skillTags": [
        "Create teams",
        "Teams channels",
        "Teams members"
    ],
    "isActive": true,
    "isPremium": false,
    "isSearchable": true
}

示例 2:根据学习内容的外部 ID 更新其元数据

以下示例演示一个请求,该请求基于学习内容的外部 ID (辅助密钥) 更新其元数据。

请求

下面为请求示例。

PATCH https://graph.microsoft.com/beta/employeeExperience/learningProviders/13727311-e7bb-470d-8b20-6a23d9030d70/learningContents(externalId='LP4471') 
Content-Type: application/json

{
    "title": "Manage classes, resources, assessment, and planning in Microsoft Teams with Beedle",
    "description": "A module to guide users through the various teaching and learning enhancements that Beedle provides within Microsoft Teams, with many examples of everyday application.",
    "contentWebUrl": "https://learn.microsoft.com/learn/modules/manage-classes-resources-assessment-planning-beedle/",
    "sourceName": "MsLearn",
    "thumbnailWebUrl": "https://syndetics.com/index.aspx?isbn=9783319672175/LC.GIF",
    "languageTag": "en-us",
    "numberOfPages": 9,
    "duration": "PT20M",
    "format": "Book",
    "level": "Beginner",
    "createdDateTime": "2018-01-01T00:00:00",
    "lastModifiedDateTime": "2021-04-01T04:26:06.1995367Z",
    "contributor": "Scott Simpson",
    "additionalTags": [
        "Create private or public teams",
        "Add members to teams"
    ],
    "skillTags": [
        "Create teams",
        "Teams channels",
        "Teams members"
    ],
    "isActive": true,
    "isPremium": false,
    "isSearchable": true
}

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 202 Accepted
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#learningProviders('13727311-e7bb-470d-8b20-6a23d9030d70')/learningContents/$entity",
    "id": "77029588-a660-46b6-ba58-3ce4d21d5678",
    "externalId": "LP4471",
    "title": "Manage classes, resources, assessment, and planning in Microsoft Teams with Beedle",
    "description": "A module to guide users through the various teaching and learning enhancements that Beedle provides within Microsoft Teams, with many examples of everyday application.",
    "contentWebUrl": "https://learn.microsoft.com/learn/modules/manage-classes-resources-assessment-planning-beedle/",
    "sourceName": "MsLearn",
    "thumbnailWebUrl": "https://syndetics.com/index.aspx?isbn=9783319672175/LC.GIF",
    "languageTag": "en-us",
    "numberOfPages": 9,
    "duration": "PT20M",
    "format": "Book",
    "level": "Beginner",
    "createdDateTime": "2018-01-01T00:00:00",
    "lastModifiedDateTime": "2021-04-01T04:26:06.1995367Z",
    "contributors": [
        "Lina Wagner",
        "Lisa Richter"
    ],
    "additionalTags": [
        "Create private or public teams",
        "Add members to teams"
    ],
    "skillTags": [
        "Create teams",
        "Teams channels",
        "Teams members"
    ],
    "isActive": true,
    "isPremium": false,
    "isSearchable": true
}