POST https://graph.microsoft.com/beta/security/alerts/updateAlerts
Content-type: application/json
{
"value": [
{
"assignedTo": "String",
"closedDateTime": "String (timestamp)",
"comments": ["String"],
"feedback": {"@odata.type": "microsoft.graph.alertFeedback"},
"id": "String (identifier)",
"status": {"@odata.type": "microsoft.graph.alertStatus"},
"tags": ["String"],
"vendorInformation":
{
"provider": "String",
"vendor": "String"
}
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Security.Alerts.UpdateAlerts;
using Microsoft.Graph.Beta.Models;
var requestBody = new UpdateAlertsPostRequestBody
{
Value = new List<Alert>
{
new Alert
{
AssignedTo = "String",
ClosedDateTime = DateTimeOffset.Parse("String (timestamp)"),
Comments = new List<string>
{
"String",
},
Feedback = new AlertFeedback
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.type" , "microsoft.graph.alertFeedback"
},
},
},
Id = "String (identifier)",
Status = new AlertStatus
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.type" , "microsoft.graph.alertStatus"
},
},
},
Tags = new List<string>
{
"String",
},
VendorInformation = new SecurityVendorInformation
{
Provider = "String",
Vendor = "String",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Alerts.UpdateAlerts.PostAsUpdateAlertsPostResponseAsync(requestBody);
mgc-beta security alerts update-alerts post --body '{\
"value": [\
{\
"assignedTo": "String",\
"closedDateTime": "String (timestamp)",\
"comments": ["String"],\
"feedback": {"@odata.type": "microsoft.graph.alertFeedback"},\
"id": "String (identifier)",\
"status": {"@odata.type": "microsoft.graph.alertStatus"},\
"tags": ["String"],\
"vendorInformation":\
{\
"provider": "String",\
"vendor": "String"\
}\
}\
]\
}\
'
// 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"
graphsecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/security"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphsecurity.NewUpdateAlertsPostRequestBody()
alert := graphmodels.NewAlert()
assignedTo := "String"
alert.SetAssignedTo(&assignedTo)
closedDateTime , err := time.Parse(time.RFC3339, "String (timestamp)")
alert.SetClosedDateTime(&closedDateTime)
comments := []string {
"String",
}
alert.SetComments(comments)
feedback := graphmodels.NewAlertFeedback()
additionalData := map[string]interface{}{
}
feedback.SetAdditionalData(additionalData)
alert.SetFeedback(feedback)
id := "String (identifier)"
alert.SetId(&id)
status := graphmodels.NewAlertStatus()
additionalData := map[string]interface{}{
}
status.SetAdditionalData(additionalData)
alert.SetStatus(status)
tags := []string {
"String",
}
alert.SetTags(tags)
vendorInformation := graphmodels.NewSecurityVendorInformation()
provider := "String"
vendorInformation.SetProvider(&provider)
vendor := "String"
vendorInformation.SetVendor(&vendor)
alert.SetVendorInformation(vendorInformation)
value := []graphmodels.Alertable {
alert,
}
requestBody.SetValue(value)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
updateAlerts, err := graphClient.Security().Alerts().UpdateAlerts().PostAsUpdateAlertsPostResponse(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.security.alerts.updatealerts.UpdateAlertsPostRequestBody updateAlertsPostRequestBody = new com.microsoft.graph.beta.security.alerts.updatealerts.UpdateAlertsPostRequestBody();
LinkedList<Alert> value = new LinkedList<Alert>();
Alert alert = new Alert();
alert.setAssignedTo("String");
OffsetDateTime closedDateTime = OffsetDateTime.parse("String (timestamp)");
alert.setClosedDateTime(closedDateTime);
LinkedList<String> comments = new LinkedList<String>();
comments.add("String");
alert.setComments(comments);
AlertFeedback feedback = new AlertFeedback();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.type", "microsoft.graph.alertFeedback");
feedback.setAdditionalData(additionalData);
alert.setFeedback(feedback);
alert.setId("String (identifier)");
AlertStatus status = new AlertStatus();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("@odata.type", "microsoft.graph.alertStatus");
status.setAdditionalData(additionalData1);
alert.setStatus(status);
LinkedList<String> tags = new LinkedList<String>();
tags.add("String");
alert.setTags(tags);
SecurityVendorInformation vendorInformation = new SecurityVendorInformation();
vendorInformation.setProvider("String");
vendorInformation.setVendor("String");
alert.setVendorInformation(vendorInformation);
value.add(alert);
updateAlertsPostRequestBody.setValue(value);
var result = graphClient.security().alerts().updateAlerts().post(updateAlertsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const alert = {
value: [
{
assignedTo: 'String',
closedDateTime: 'String (timestamp)',
comments: ['String'],
feedback: {'@odata.type': 'microsoft.graph.alertFeedback'},
id: 'String (identifier)',
status: {'@odata.type': 'microsoft.graph.alertStatus'},
tags: ['String'],
vendorInformation:
{
provider: 'String',
vendor: 'String'
}
}
]
};
await client.api('/security/alerts/updateAlerts')
.version('beta')
.post(alert);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Security\Alerts\UpdateAlerts\UpdateAlertsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Alert;
use Microsoft\Graph\Beta\Generated\Models\AlertFeedback;
use Microsoft\Graph\Beta\Generated\Models\AlertStatus;
use Microsoft\Graph\Beta\Generated\Models\SecurityVendorInformation;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UpdateAlertsPostRequestBody();
$valueAlert1 = new Alert();
$valueAlert1->setAssignedTo('String');
$valueAlert1->setClosedDateTime(new \DateTime('String (timestamp)'));
$valueAlert1->setComments(['String', ]);
$valueAlert1Feedback = new AlertFeedback();
$additionalData = [
'@odata.type' => 'microsoft.graph.alertFeedback',
];
$valueAlert1Feedback->setAdditionalData($additionalData);
$valueAlert1->setFeedback($valueAlert1Feedback);
$valueAlert1->setId('String (identifier)');
$valueAlert1Status = new AlertStatus();
$additionalData = [
'@odata.type' => 'microsoft.graph.alertStatus',
];
$valueAlert1Status->setAdditionalData($additionalData);
$valueAlert1->setStatus($valueAlert1Status);
$valueAlert1->setTags(['String', ]);
$valueAlert1VendorInformation = new SecurityVendorInformation();
$valueAlert1VendorInformation->setProvider('String');
$valueAlert1VendorInformation->setVendor('String');
$valueAlert1->setVendorInformation($valueAlert1VendorInformation);
$valueArray []= $valueAlert1;
$requestBody->setValue($valueArray);
$result = $graphServiceClient->security()->alerts()->updateAlerts()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Security
$params = @{
value = @(
@{
assignedTo = "String"
closedDateTime = [System.DateTime]::Parse("String (timestamp)")
comments = @(
"String"
)
feedback = @{
"@odata.type" = "microsoft.graph.alertFeedback"
}
id = "String (identifier)"
status = @{
"@odata.type" = "microsoft.graph.alertStatus"
}
tags = @(
"String"
)
vendorInformation = @{
provider = "String"
vendor = "String"
}
}
)
}
Update-MgBetaSecurityAlertMultiple -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.security.alerts.update_alerts.update_alerts_post_request_body import UpdateAlertsPostRequestBody
from msgraph_beta.generated.models.alert import Alert
from msgraph_beta.generated.models.alert_feedback import AlertFeedback
from msgraph_beta.generated.models.alert_status import AlertStatus
from msgraph_beta.generated.models.security_vendor_information import SecurityVendorInformation
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UpdateAlertsPostRequestBody(
value = [
Alert(
assigned_to = "String",
closed_date_time = "String (timestamp)",
comments = [
"String",
],
feedback = AlertFeedback(
additional_data = {
"@odata_type" : "microsoft.graph.alertFeedback",
}
),
id = "String (identifier)",
status = AlertStatus(
additional_data = {
"@odata_type" : "microsoft.graph.alertStatus",
}
),
tags = [
"String",
],
vendor_information = SecurityVendorInformation(
provider = "String",
vendor = "String",
),
),
],
)
result = await graph_client.security.alerts.update_alerts.post(request_body)