L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins)
Options de personnalisation de modèle de message. La personnalisation est définie dans la console d’administration Intune. Les valeurs possibles sont les suivantes : none, includeCompanyLogo, includeCompanyName, includeContactInformation, includeCompanyPortalLink, includeDeviceDetails et unknownFutureValue.
roleScopeTagIds
Collection de chaînes
Liste des balises d’étendue pour cette instance d’entité.
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 200 OK et un objet notificationMessageTemplate mis à jour dans le corps de la réponse.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new NotificationMessageTemplate
{
OdataType = "#microsoft.graph.notificationMessageTemplate",
DisplayName = "Display Name value",
DefaultLocale = "Default Locale value",
BrandingOptions = NotificationTemplateBrandingOptions.IncludeCompanyLogo,
RoleScopeTagIds = new List<string>
{
"Role Scope Tag Ids value",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.NotificationMessageTemplates["{notificationMessageTemplate-id}"].PatchAsync(requestBody);
// 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.NewNotificationMessageTemplate()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
defaultLocale := "Default Locale value"
requestBody.SetDefaultLocale(&defaultLocale)
brandingOptions := graphmodels.INCLUDECOMPANYLOGO_NOTIFICATIONTEMPLATEBRANDINGOPTIONS
requestBody.SetBrandingOptions(&brandingOptions)
roleScopeTagIds := []string {
"Role Scope Tag Ids value",
}
requestBody.SetRoleScopeTagIds(roleScopeTagIds)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
notificationMessageTemplates, err := graphClient.DeviceManagement().NotificationMessageTemplates().ByNotificationMessageTemplateId("notificationMessageTemplate-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
NotificationMessageTemplate notificationMessageTemplate = new NotificationMessageTemplate();
notificationMessageTemplate.setOdataType("#microsoft.graph.notificationMessageTemplate");
notificationMessageTemplate.setDisplayName("Display Name value");
notificationMessageTemplate.setDefaultLocale("Default Locale value");
notificationMessageTemplate.setBrandingOptions(EnumSet.of(NotificationTemplateBrandingOptions.IncludeCompanyLogo));
LinkedList<String> roleScopeTagIds = new LinkedList<String>();
roleScopeTagIds.add("Role Scope Tag Ids value");
notificationMessageTemplate.setRoleScopeTagIds(roleScopeTagIds);
NotificationMessageTemplate result = graphClient.deviceManagement().notificationMessageTemplates().byNotificationMessageTemplateId("{notificationMessageTemplate-id}").patch(notificationMessageTemplate);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\NotificationMessageTemplate;
use Microsoft\Graph\Generated\Models\NotificationTemplateBrandingOptions;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new NotificationMessageTemplate();
$requestBody->setOdataType('#microsoft.graph.notificationMessageTemplate');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDefaultLocale('Default Locale value');
$requestBody->setBrandingOptions(new NotificationTemplateBrandingOptions('includeCompanyLogo'));
$requestBody->setRoleScopeTagIds(['Role Scope Tag Ids value', ]);
$result = $graphServiceClient->deviceManagement()->notificationMessageTemplates()->byNotificationMessageTemplateId('notificationMessageTemplate-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.notification_message_template import NotificationMessageTemplate
from msgraph.generated.models.notification_template_branding_options import NotificationTemplateBrandingOptions
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = NotificationMessageTemplate(
odata_type = "#microsoft.graph.notificationMessageTemplate",
display_name = "Display Name value",
default_locale = "Default Locale value",
branding_options = NotificationTemplateBrandingOptions.IncludeCompanyLogo,
role_scope_tag_ids = [
"Role Scope Tag Ids value",
],
)
result = await graph_client.device_management.notification_message_templates.by_notification_message_template_id('notificationMessageTemplate-id').patch(request_body)
Voici un exemple de réponse. Remarque : l’objet de réponse illustré ici peut être tronqué à des fins de concision. Toutes les propriétés sont renvoyées à partir d’un appel réel.