创建 urlThreatSubmission
本文内容
命名空间:microsoft.graph.security
重要
Microsoft Graph 中版本下的 /beta
API 可能会更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 在 v1.0 中是否可用,请使用 版本 选择器。
创建新的 urlThreatSubmission 对象。
权限
调用此 API 需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
ThreatSubmission.ReadWrite,ThreatSubmission.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持
应用程序
ThreatSubmission.ReadWrite.All
HTTP 请求
POST /security/threatSubmission/urlThreats
名称
说明
Authorization
持有者 {token}。 必填。
Content-Type
application/json. 必需。
请求正文
在请求正文中,提供 urlThreatSubmission 对象的 JSON 表示形式。
还可以在创建 urlThreatSubmission 时指定以下属性。
属性
类型
说明
“类别”
submissionCategory
继承自 threatSubmission 和必需字段。 可能的值包括 notJunk
、spam
、phishing
、malware
、unknownFutureValue
。 它用于告知你将 URL 报告为什么。
webUrl
String
要提交的 webUrl。 必填。
响应
如果成功,此方法在响应正文中返回响应 201 Created
代码和 urlThreatSubmission 对象。
示例
请求
请求示例如下所示。
POST https://graph.microsoft.com/beta/security/threatSubmission/urlThreats
Content-type: application/json
{
"@odata.type": "#microsoft.graph.urlThreatSubmission",
"category": "phishing",
"webUrl": "http://phishing.contoso.com"
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Models.Security.UrlThreatSubmission
{
OdataType = "#microsoft.graph.urlThreatSubmission",
Category = Microsoft.Graph.Beta.Models.Security.SubmissionCategory.Phishing,
WebUrl = "http://phishing.contoso.com",
};
var result = await graphClient.Security.ThreatSubmission.UrlThreats.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const urlThreatSubmission = {
'@odata.type': '#microsoft.graph.urlThreatSubmission',
category: 'phishing',
webUrl: 'http://phishing.contoso.com'
};
await client.api('/security/threatSubmission/urlThreats')
.version('beta')
.post(urlThreatSubmission);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
UrlThreatSubmission urlThreatSubmission = new UrlThreatSubmission();
urlThreatSubmission.category = SubmissionCategory.PHISHING;
urlThreatSubmission.webUrl = "http://phishing.contoso.com";
graphClient.security().threatSubmission().urlThreats()
.buildRequest()
.post(urlThreatSubmission);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewUrlThreatSubmission()
category := graphmodels.PHISHING_SUBMISSIONCATEGORY
requestBody.SetCategory(&category)
webUrl := "http://phishing.contoso.com"
requestBody.SetWebUrl(&webUrl)
result, err := graphClient.Security().ThreatSubmission().UrlThreats().Post(context.Background(), requestBody, nil)
Import-Module Microsoft.Graph.Security
$params = @{
"@odata.type" = "#microsoft.graph.urlThreatSubmission"
Category = "phishing"
WebUrl = "http://phishing.contoso.com"
}
New-MgSecurityThreatSubmissionUrlThreat -BodyParameter $params
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new UrlThreatSubmission();
$requestBody->set@odatatype('#microsoft.graph.urlThreatSubmission');
$requestBody->setCategory(new SubmissionCategory('phishing'));
$requestBody->setWebUrl('http://phishing.contoso.com');
$requestResult = $graphServiceClient->security()->threatSubmission()->urlThreats()->post($requestBody);
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#security/threatSubmission/urlThreatSubmission/$entity",
"@odata.type": "#microsoft.graph.security.urlThreatSubmission",
"category": "phishing",
"id": "49c5ef5b-1f65-444a-e6b9-08d772ea2059",
"createdDateTime": "2021-10-10T03:30:18.6890937Z",
"contentType": "url",
"webUrl": "http://phishing.contoso.com",
"status": "running",
"source": "administrator",
"createdBy": {
"user": {
"identity": "c52ce8db-3e4b-4181-93c4-7d6b6bffaf60",
"displayName": "Ronald Admin",
"email": "tifc@a830edad9050849eqtpwbjzxodq.onmicrosoft.com"
}
},
"result": {
"detail": "underInvestigation"
},
"adminReview": null,
"tenantId" : "39238e87-b5ab-4ef6-a559-af54c6b07b42"
}