Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DLGross
Frequent Visitor

Web.Contents failed to get contents (400) bad request error

I am getting the subject error when I try to query the advanced hunting api in Defender. The query works fine in the Defender portal. Can anyone provide any troubleshooting tips?

1 ACCEPTED SOLUTION
v-saisrao-msft
Community Support
Community Support

Hi  @DLGross,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

The suggestion from @lbendlin, is a great starting point. Testing your API call in Postman can help determine whether the issue is with the API itself or how it’s being called using Web.Contents. 

If it works in Postman, the issue might be related to: 

  • Make sure you are using a valid OAuth 2.0 token with the required permissions (AdvancedHunting.Read or AdvancedHunting.Read.All). 
  • Ensure you are using the correct endpoint for the Advanced Hunting API. The API requires a POST method, not GET. 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

View solution in original post

5 REPLIES 5
v-saisrao-msft
Community Support
Community Support

Hi @DLGross,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @DLGross,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @DLGross,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-saisrao-msft
Community Support
Community Support

Hi  @DLGross,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

The suggestion from @lbendlin, is a great starting point. Testing your API call in Postman can help determine whether the issue is with the API itself or how it’s being called using Web.Contents. 

If it works in Postman, the issue might be related to: 

  • Make sure you are using a valid OAuth 2.0 token with the required permissions (AdvancedHunting.Read or AdvancedHunting.Read.All). 
  • Ensure you are using the correct endpoint for the Advanced Hunting API. The API requires a POST method, not GET. 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

lbendlin
Super User
Super User

Does it work in Postman? How are you authenticating?

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors