tiIndicator:deleteTiIndicators
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
在一个 (() 个请求)中删除多个威胁情报和 TI 智能指示器。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
ThreatIndicators.ReadWrite.OwnedBy
委派(个人 Microsoft 帐户)
不支持。
应用程序
ThreatIndicators.ReadWrite.OwnedBy
HTTP 请求
POST /security/tiIndicators/deleteTiIndicators
名称
说明
Authorization
Bearer {code}
请求正文
在请求正文中,提供具有以下参数的 JSON 对象。
参数
类型
说明
值
字符串集合
要删除的 tiIndicator id集合。
响应
如果成功,此方法在响应 200, OK 正文中返回 响应代码和 resultInfo 集合对象。 如果出现错误,此方法将返回 响应 206 Partial Content 代码。 有关详细信息 , 请参阅错误。
示例
以下示例演示如何调用此 API。
请求
下面展示了示例请求。
POST https://graph.microsoft.com/beta/security/tiIndicators/deleteTiIndicators
Content-type: application/json
{
"value": [
"id-value1",
"id-value2"
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var value = new List<String>()
{
"id-value1",
"id-value2"
};
await graphClient.Security.TiIndicators
.DeleteTiIndicators(value)
.Request()
.PostAsync();
const options = {
authProvider,
};
const client = Client.init(options);
const resultInfo = {
value: [
'id-value1',
'id-value2'
]
};
await client.api('/security/tiIndicators/deleteTiIndicators')
.version('beta')
.post(resultInfo);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/security/tiIndicators/deleteTiIndicators"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSMutableArray *valueList = [[NSMutableArray alloc] init];
[valueList addObject: @"id-value1"];
[valueList addObject: @"id-value2"];
payloadDictionary[@"value"] = valueList;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<String> valueList = new LinkedList<String>();
valueList.add("id-value1");
valueList.add("id-value2");
graphClient.security().tiIndicators()
.deleteTiIndicators(TiIndicatorDeleteTiIndicatorsParameterSet
.newBuilder()
.withValue(valueList)
.build())
.buildRequest()
.post();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewValueRequestBody()
requestBody.SetValue( []String {
"id-value1",
"id-value2",
}
result, err := graphClient.Security().TiIndicators().DeleteTiIndicators().Post(requestBody)
Import-Module Microsoft.Graph.Security
$params = @{
Value = @(
"id-value1"
"id-value2"
)
}
Remove-MgSecurityTiIndicatorMultiple -BodyParameter $params
响应
下面展示了示例响应。
备注
为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"code": 0,
"message": "message-value",
"subCode": "subCode-value"
}
]
}