我正在尝试向 SEPM API 提交请求,特别是使用赛门铁克提供的文档的这一部分,但是每当我尝试运行查询时,我都会收到(400) Bad request
错误消息,老实说,我没有看到格式错误要求。这是我到目前为止使用的代码:
#Report type: Hour, Day, Week or Month
$reportType = "Hour"
#Get system time
$startTime = Get-Date (Get-Date).AddHours(-1)
$endTime = Get-Date
#Convert time to Epoch
$startTimeEpoch = Get-Date ($startTime).ToUniversalTime() -UFormat %s
$endTimeEpoch = Get-Date ($endTime).ToUniversalTime() -UFormat %s
$header = @{
"Content-Type" = "application/json"
"Authorization"= "Bearer $authToken"
}
$response = Invoke-RestMethod `
-Uri "https://example:8446/sepm/api/v1/stats/client/malware/$reportType/$startTimeEpoch/to/$endTimeEpoch" `
-Method GET `
-Headers $header
Uri 扩展如下"https://example:8446/sepm/api/v1/stats/client/malware/Hour/1592937124.87678/to/1592940724.8778"