Пространство имен: microsoft.graph
Создайте новый объект learningProvider и зарегистрируйте его в Viva Learning, используя указанное отображаемое имя и логотипы для различных тем.
Этот API доступен в следующих национальных облачных развертываниях.
Глобальная служба |
Правительство США L4 |
Правительство США L5 (DOD) |
Китай управляется 21Vianet |
✅ |
❌ |
❌ |
❌ |
Разрешения
Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
Тип разрешения |
Разрешения с наименьшими привилегиями |
Более высокие привилегированные разрешения |
Делегированные (рабочая или учебная учетная запись) |
LearningProvider.ReadWrite |
Недоступно. |
Делегированные (личная учетная запись Майкрософт) |
Не поддерживается. |
Не поддерживается. |
Для приложений |
Не поддерживается. |
Не поддерживается. |
Заметка: Пользователю требуется следующее:
- Viva Viva Learning лицензия на набор или Viva Learning.
- Поддерживаемая роль Microsoft Entra, где администратор знаний является наименее привилегированной поддерживаемой ролью.
HTTP-запрос
POST /employeeExperience/learningProviders
Текст запроса
В тексте запроса укажите представление объекта learningProvider в формате JSON.
При создании learningProvider можно указать следующие свойства.
Свойство |
Тип |
Описание |
displayName |
String |
Отображаемое имя, отображаемое в Viva Learning. Обязательно. |
isCourseActivitySyncEnabled |
Логический |
Указывает, может ли поставщик принимать записи learningCourseActivity . Значение по умолчанию — false . Задайте значение , true чтобы сделать learningCourseActivities доступным для этого поставщика. |
loginWebUrl |
String |
URL-адрес проверки подлинности для доступа к курсам для поставщика. Необязательный параметр. |
longLogoWebUrlForDarkTheme |
String |
Длинный URL-адрес логотипа для темного режима, который должен быть общедоступным изображением. Этот образ будет сохранен в хранилище BLOB-объектов Viva Learning для отрисовки в приложении Viva Learning. Обязательно. |
longLogoWebUrlForLightTheme |
String |
Длинный URL-адрес логотипа для светового режима, который должен быть общедоступным изображением. Этот образ будет сохранен в хранилище BLOB-объектов Viva Learning для отрисовки в приложении Viva Learning. Обязательно. |
squareLogoWebUrlForDarkTheme |
String |
URL-адрес квадратного логотипа для темного режима, который должен быть общедоступным изображением. Этот образ будет сохранен в хранилище BLOB-объектов Viva Learning для отрисовки в приложении Viva Learning. Обязательно. |
squareLogoWebUrlForLightTheme |
String |
URL-адрес квадратного логотипа для режима освещения, который должен быть общедоступным изображением. Этот образ будет сохранен в хранилище BLOB-объектов Viva Learning для отрисовки в приложении Viva Learning. Обязательно. |
Отклик
В случае успешного выполнения этот метод возвращает код отклика 201 Created
и объект learningProvider в теле отклика.
Примеры
Запрос
Ниже показан пример запроса.
POST https://graph.microsoft.com/v1.0/employeeExperience/learningProviders
Content-Type: application/json
{
"displayName": "Microsoft",
"squareLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"longLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"squareLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"longLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"loginWebUrl": "https://www.linkedin.com/learning-login/teams",
"isCourseActivitySyncEnabled": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new LearningProvider
{
DisplayName = "Microsoft",
SquareLogoWebUrlForDarkTheme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
LongLogoWebUrlForDarkTheme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
SquareLogoWebUrlForLightTheme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
LongLogoWebUrlForLightTheme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
LoginWebUrl = "https://www.linkedin.com/learning-login/teams",
IsCourseActivitySyncEnabled = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.LearningProviders.PostAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
mgc employee-experience learning-providers create --body '{\
"displayName": "Microsoft",\
"squareLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",\
"longLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",\
"squareLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",\
"longLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",\
"loginWebUrl": "https://www.linkedin.com/learning-login/teams",\
"isCourseActivitySyncEnabled": true\
}\
'
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewLearningProvider()
displayName := "Microsoft"
requestBody.SetDisplayName(&displayName)
squareLogoWebUrlForDarkTheme := "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png"
requestBody.SetSquareLogoWebUrlForDarkTheme(&squareLogoWebUrlForDarkTheme)
longLogoWebUrlForDarkTheme := "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png"
requestBody.SetLongLogoWebUrlForDarkTheme(&longLogoWebUrlForDarkTheme)
squareLogoWebUrlForLightTheme := "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png"
requestBody.SetSquareLogoWebUrlForLightTheme(&squareLogoWebUrlForLightTheme)
longLogoWebUrlForLightTheme := "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png"
requestBody.SetLongLogoWebUrlForLightTheme(&longLogoWebUrlForLightTheme)
loginWebUrl := "https://www.linkedin.com/learning-login/teams"
requestBody.SetLoginWebUrl(&loginWebUrl)
isCourseActivitySyncEnabled := true
requestBody.SetIsCourseActivitySyncEnabled(&isCourseActivitySyncEnabled)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
learningProviders, err := graphClient.EmployeeExperience().LearningProviders().Post(context.Background(), requestBody, nil)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LearningProvider learningProvider = new LearningProvider();
learningProvider.setDisplayName("Microsoft");
learningProvider.setSquareLogoWebUrlForDarkTheme("https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png");
learningProvider.setLongLogoWebUrlForDarkTheme("https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png");
learningProvider.setSquareLogoWebUrlForLightTheme("https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png");
learningProvider.setLongLogoWebUrlForLightTheme("https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png");
learningProvider.setLoginWebUrl("https://www.linkedin.com/learning-login/teams");
learningProvider.setIsCourseActivitySyncEnabled(true);
LearningProvider result = graphClient.employeeExperience().learningProviders().post(learningProvider);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const learningProvider = {
displayName: 'Microsoft',
squareLogoWebUrlForDarkTheme: 'https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png',
longLogoWebUrlForDarkTheme: 'https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png',
squareLogoWebUrlForLightTheme: 'https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png',
longLogoWebUrlForLightTheme: 'https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png',
loginWebUrl: 'https://www.linkedin.com/learning-login/teams',
isCourseActivitySyncEnabled: true
};
await client.api('/employeeExperience/learningProviders')
.post(learningProvider);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\LearningProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new LearningProvider();
$requestBody->setDisplayName('Microsoft');
$requestBody->setSquareLogoWebUrlForDarkTheme('https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png');
$requestBody->setLongLogoWebUrlForDarkTheme('https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png');
$requestBody->setSquareLogoWebUrlForLightTheme('https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png');
$requestBody->setLongLogoWebUrlForLightTheme('https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png');
$requestBody->setLoginWebUrl('https://www.linkedin.com/learning-login/teams');
$requestBody->setIsCourseActivitySyncEnabled(true);
$result = $graphServiceClient->employeeExperience()->learningProviders()->post($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.learning_provider import LearningProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = LearningProvider(
display_name = "Microsoft",
square_logo_web_url_for_dark_theme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
long_logo_web_url_for_dark_theme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
square_logo_web_url_for_light_theme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
long_logo_web_url_for_light_theme = "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
login_web_url = "https://www.linkedin.com/learning-login/teams",
is_course_activity_sync_enabled = True,
)
result = await graph_client.employee_experience.learning_providers.post(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Отклик
Ниже показан пример отклика.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#learningProviders/$entity",
"id": "ba9790ef-21d5-4c17-808c-acda55230253",
"displayName": "Microsoft",
"squareLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"longLogoWebUrlForDarkTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"squareLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"longLogoWebUrlForLightTheme": "https://support.content.office.net/en-us/media/4c531d12-4c13-4782-a6e4-4b8f991801a3.png",
"loginWebUrl": "https://www.linkedin.com/learning-login/teams",
"isCourseActivitySyncEnabled": true
}