Forum Discussion
Shows 403 when trying to do "get"->api.security.microsoft.com/api/dataexportsettings via code
Fr4nsec Thanks for replying.
Below are the roles I have when I try the token on JWT.
All of those are "Application" permissions. Here's what I do after getting the token -
$token = "TOKENHERE"
$headers = @{
'Content-Type' = 'application/json'
Accept = 'application/json'
Authorization = "Bearer $token"
}
$url = "https://api.security.microsoft.com/api/dataexportsettings"
Invoke-WebRequest -Method Get -Uri $url -Headers $headers
What I get -
Any idea which permission I'm lacking here? Any suggestions are appreciated!
KeshavKhanna I think it's something to do with the application not having permission to access the API. When trying to create a new export setting, I get this error: {"error":{"code":"Forbidden","message":"Application context is not allowed to access this API. Expected user context.","target":"|."}}