常见的 Microsoft 365 Defender REST API 错误代码Common Microsoft 365 Defender REST API error codes

重要

改进的 Microsoft 365 安全中心现在可用。The improved Microsoft 365 security center is now available. 此新体验将 Defender for Endpoint、Defender for Office、365 Microsoft 365 Defender 等引入了 Microsoft 365 安全中心。This new experience brings Defender for Endpoint, Defender for Office 365, Microsoft 365 Defender, and more into the Microsoft 365 security center. 了解新增功能Learn what's new.

适用于:Applies to:

  • Microsoft 365 DefenderMicrosoft 365 Defender

重要

某些信息与预发布的产品有关,在商业发布之前可能有重大修改。Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft 对此处所提供的信息不作任何明示或默示的保证。Microsoft makes no warranties, express or implied, with respect to the information provided here.

任何 Microsoft 365 Defender API 上的操作可能会返回错误代码。Error codes may be returned by an operation on any of the Microsoft 365 Defender APIs. 每个错误响应都将包含一条错误消息,有助于解决问题。Every error response will contain an error message, which can help resolve the problem. 表部分中的错误消息列提供了一些示例消息。The error message column in the table section provides some sample messages. 实际消息的内容因触发响应的因素而异。The content of actual messages will vary based on the factors that triggered the response. 表中用尖括号指示变量内容。Variable content is indicated in the table by angle brackets.

错误代码Error codes

错误代码Error code HTTP 状态代码HTTP status code 邮件Message
BadRequestBadRequest BadRequest (400) BadRequest (400) 常规错误请求错误消息。General Bad Request error message.
ODataErrorODataError BadRequest (400) BadRequest (400) 无效的 OData URI 查询 <the specific error is specified> 。Invalid OData URI query <the specific error is specified>.
InvalidInputInvalidInput BadRequest (400) BadRequest (400) 输入无效 <the invalid input> 。Invalid input <the invalid input>.
InvalidRequestBodyInvalidRequestBody BadRequest (400) BadRequest (400) 无效的请求正文。Invalid request body.
InvalidHashValueInvalidHashValue BadRequest (400) BadRequest (400) 哈希 <the invalid hash> 值无效。Hash value <the invalid hash> is invalid.
InvalidDomainNameInvalidDomainName BadRequest (400) BadRequest (400) 域名 <the invalid domain> 无效。Domain name <the invalid domain> is invalid.
InvalidIpAddressInvalidIpAddress BadRequest (400) BadRequest (400) IP 地址 <the invalid IP> 无效。IP address <the invalid IP> is invalid.
InvalidUrlInvalidUrl BadRequest (400) BadRequest (400) URL <the invalid URL> 无效。URL <the invalid URL> is invalid.
MaximumBatchSizeExceededMaximumBatchSizeExceeded BadRequest (400) BadRequest (400) 已超出最大批次大小。Maximum batch size exceeded. Received: <batch size received> , allowed: {batch size allowed}.Received: <batch size received>, allowed: {batch size allowed}.
MissingRequiredParameterMissingRequiredParameter BadRequest (400) BadRequest (400) 参数 <the missing parameter> 缺失。Parameter <the missing parameter> is missing.
OsPlatformNotSupportedOsPlatformNotSupported BadRequest (400) BadRequest (400) 此操作 <the client OS Platform> 不支持操作系统平台。OS Platform <the client OS Platform> is not supported for this action.
ClientVersionNotSupportedClientVersionNotSupported BadRequest (400) BadRequest (400) <The requested action> 在客户端版本及 <supported client version> 以上版本上受支持。<The requested action> is supported on client version <supported client version> and above.
未经授权 (Unauthorized)Unauthorized 未经授权 (401) Unauthorized (401) 未经授权 (Unauthorized)Unauthorized

注意:通常是由无效或过期的授权标头导致的。Note: Usually caused by an invalid or expired authorization header.
禁止访问 (Forbidden)Forbidden 禁止 (403) Forbidden (403) 禁止访问 (Forbidden)Forbidden

注意:有效令牌,但操作权限不足Note: Valid token but insufficient permission for the action.
DisabledFeatureDisabledFeature 禁止 (403) Forbidden (403) 未启用租户功能。Tenant feature is not enabled.
DisallowedOperationDisallowedOperation 禁止 (403) Forbidden (403) <the disallowed operation and the reason>.<the disallowed operation and the reason>.
NotFoundNotFound 404 (未找到) Not Found (404) "常规未找到"错误消息。General Not Found error message.
ResourceNotFoundResourceNotFound 404 (未找到) Not Found (404) 未找到 <the requested resource> 资源。Resource <the requested resource> was not found.
InternalServerErrorInternalServerError 内部服务器错误 (500) Internal Server Error (500) 注意:无错误消息,请重试该操作或联系 Microsoft(如果未解决)Note: No error message, retry the operation or contact Microsoft if it does not get resolved

示例Examples

{
    "error": {
        "code": "ResourceNotFound",
        "message": "Machine 123123123 was not found",
        "target": "43f4cb08-8fac-4b65-9db1-745c2ae65f3a"
    }
}
{
    "error": {
        "code": "InvalidRequestBody",
        "message": "Request body is incorrect",
        "target": "1fa66c0f-18bd-4133-b378-36d76f3a2ba0"
    }
}

Body 参数Body parameters

重要

正文参数区分大小写。Body parameters are case-sensitive.

如果遇到 InvalidRequestBodyMissingRequiredParameter 错误,这可能是由拼写错误导致的。If you experience an InvalidRequestBody or MissingRequiredParameter error, it might be caused by a typo. 查看 API 文档并检查提交的参数是否与相关示例匹配。Review the API documentation and check that the submitted parameters match the relevant example.

跟踪 IDTracking ID

每个错误响应都包含用于跟踪的唯一 ID 参数。Each error response contains a unique ID parameter for tracking. 此参数的属性名称是 目标The property name of this parameter is target. 当我们就错误联系我们时,附加此 ID 将有助于我们找到问题的根本原因。When contacting us about an error, attaching this ID will help us find the root cause of the problem.