Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Security;
var requestBody = new FileContentThreatSubmission
{
OdataType = "#microsoft.graph.security.fileContentThreatSubmission",
Category = SubmissionCategory.Malware,
FileName = "test.html",
FileContent = "UmVjZWl2ZWQ6IGZyb20gTVcyUFIwME1CMDMxNC5uYW1wcmQwMC.....",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.ThreatSubmission.FileThreats.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelssecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security"
//other-imports
)
requestBody := graphmodelssecurity.NewFileThreatSubmission()
category := graphmodels.MALWARE_SUBMISSIONCATEGORY
requestBody.SetCategory(&category)
fileName := "test.html"
requestBody.SetFileName(&fileName)
fileContent := "UmVjZWl2ZWQ6IGZyb20gTVcyUFIwME1CMDMxNC5uYW1wcmQwMC....."
requestBody.SetFileContent(&fileContent)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
fileThreats, err := graphClient.Security().ThreatSubmission().FileThreats().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.security.FileContentThreatSubmission fileThreatSubmission = new com.microsoft.graph.beta.models.security.FileContentThreatSubmission();
fileThreatSubmission.setOdataType("#microsoft.graph.security.fileContentThreatSubmission");
fileThreatSubmission.setCategory(com.microsoft.graph.beta.models.security.SubmissionCategory.Malware);
fileThreatSubmission.setFileName("test.html");
fileThreatSubmission.setFileContent("UmVjZWl2ZWQ6IGZyb20gTVcyUFIwME1CMDMxNC5uYW1wcmQwMC.....");
com.microsoft.graph.models.security.FileThreatSubmission result = graphClient.security().threatSubmission().fileThreats().post(fileThreatSubmission);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Security\FileContentThreatSubmission;
use Microsoft\Graph\Beta\Generated\Models\Security\SubmissionCategory;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new FileContentThreatSubmission();
$requestBody->setOdataType('#microsoft.graph.security.fileContentThreatSubmission');
$requestBody->setCategory(new SubmissionCategory('malware'));
$requestBody->setFileName('test.html');
$requestBody->setFileContent('UmVjZWl2ZWQ6IGZyb20gTVcyUFIwME1CMDMxNC5uYW1wcmQwMC.....');
$result = $graphServiceClient->security()->threatSubmission()->fileThreats()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.security.file_content_threat_submission import FileContentThreatSubmission
from msgraph_beta.generated.models.submission_category import SubmissionCategory
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FileContentThreatSubmission(
odata_type = "#microsoft.graph.security.fileContentThreatSubmission",
category = SubmissionCategory.Malware,
file_name = "test.html",
file_content = "UmVjZWl2ZWQ6IGZyb20gTVcyUFIwME1CMDMxNC5uYW1wcmQwMC.....",
)
result = await graph_client.security.threat_submission.file_threats.post(request_body)