Crea un reemplazo para un remitente identificado mediante una dirección SMTP. Los mensajes futuros de esa dirección SMTP se clasificarán sistemáticamente como se especifica en la invalidación.
Nota
Si ya existe una invalidación con la misma dirección SMTP, los campos classifyAs y name de esa invalidación se actualizan con los valores proporcionados.
El número máximo de invalidaciones que admite un buzón es de 1000, basado en direcciones SMTP de remitentes únicos.
La operación POST solo admite la creación de invalidaciones de una en una.
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
Mail.ReadWrite
No disponible.
Delegado (cuenta personal de Microsoft)
Mail.ReadWrite
No disponible.
Aplicación
Mail.ReadWrite
No disponible.
Solicitud HTTP
POST /me/inferenceClassification/overrides
POST /users/{id}/inferenceClassification/overrides
Si se ejecuta correctamente, este método devuelve el código de respuesta 201 Created y un objeto inferenceClassificationOverride en el cuerpo de la respuesta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new InferenceClassificationOverride
{
ClassifyAs = InferenceClassificationType.Focused,
SenderEmailAddress = new EmailAddress
{
Name = "Samantha Booth",
Address = "samanthab@contoso.com",
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.InferenceClassification.Overrides.PostAsync(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.NewInferenceClassificationOverride()
classifyAs := graphmodels.FOCUSED_INFERENCECLASSIFICATIONTYPE
requestBody.SetClassifyAs(&classifyAs)
senderEmailAddress := graphmodels.NewEmailAddress()
name := "Samantha Booth"
senderEmailAddress.SetName(&name)
address := "samanthab@contoso.com"
senderEmailAddress.SetAddress(&address)
requestBody.SetSenderEmailAddress(senderEmailAddress)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
overrides, err := graphClient.Me().InferenceClassification().Overrides().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
InferenceClassificationOverride inferenceClassificationOverride = new InferenceClassificationOverride();
inferenceClassificationOverride.setClassifyAs(InferenceClassificationType.Focused);
EmailAddress senderEmailAddress = new EmailAddress();
senderEmailAddress.setName("Samantha Booth");
senderEmailAddress.setAddress("samanthab@contoso.com");
inferenceClassificationOverride.setSenderEmailAddress(senderEmailAddress);
InferenceClassificationOverride result = graphClient.me().inferenceClassification().overrides().post(inferenceClassificationOverride);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\InferenceClassificationOverride;
use Microsoft\Graph\Generated\Models\InferenceClassificationType;
use Microsoft\Graph\Generated\Models\EmailAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InferenceClassificationOverride();
$requestBody->setClassifyAs(new InferenceClassificationType('focused'));
$senderEmailAddress = new EmailAddress();
$senderEmailAddress->setName('Samantha Booth');
$senderEmailAddress->setAddress('samanthab@contoso.com');
$requestBody->setSenderEmailAddress($senderEmailAddress);
$result = $graphServiceClient->me()->inferenceClassification()->overrides()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Mail
$params = @{
classifyAs = "focused"
senderEmailAddress = @{
name = "Samantha Booth"
address = "samanthab@contoso.com"
}
}
# A UPN can also be used as -UserId.
New-MgUserInferenceClassificationOverride -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.inference_classification_override import InferenceClassificationOverride
from msgraph.generated.models.inference_classification_type import InferenceClassificationType
from msgraph.generated.models.email_address import EmailAddress
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = InferenceClassificationOverride(
classify_as = InferenceClassificationType.Focused,
sender_email_address = EmailAddress(
name = "Samantha Booth",
address = "samanthab@contoso.com",
),
)
result = await graph_client.me.inference_classification.overrides.post(request_body)