List Incident API for Microsoft Defender

Kishor 1 Reputation point
2022-10-10T19:40:36.34+00:00

Hi,

I followed the page https://learn.microsoft.com/en-us/microsoft-365/security/defender/api-create-app-web?view=o365-worldwide for getting the access token and when I am hitting the List Incident API https://learn.microsoft.com/en-us/microsoft-365/security/defender/api-list-incidents?view=o365-worldwide I am getting below response, could you please help me to resolve the issue?

{
"error": {
"code": "Unauthorized",
"message": "Authorization has been denied for this request.",
"target": "e66f4d95-4ee7-4418-8d0e-7bd1a898a9f5"
}
}

Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
Microsoft Security | Microsoft Defender | Microsoft Defender for Cloud
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bhanu Kiran 3,616 Reputation points
    2022-10-11T02:30:26.417+00:00

    Hi @Kishor ,

    As per the documentation you need to have view permission for incidents in the portal when obtaining the token. Please validate the same.

    249146-incidents.png

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Limitless Technology 44,776 Reputation points
    2022-10-12T09:42:15.573+00:00

    Hello there,

    In the ValuesController there is an attribute Authorize are you using this attribute?

    If so then you must first register a user, and then login to get user's token, then you can use the token to authorize your self and get access .

    ------------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.