Postman API Body format - insightVM

Hi,

Please could someone let me know how to format the Body in API calls when using Postman, like those used in POST Asset Search?

The documentation shows an example like this:

{
  "match": "all",
  "filters": [
     { "field": "service-name", "operator": "contains", "value": "ssh"}
  ]
}

But pasting that into the Body section as Raw with the JSON option selected results in a 415 Unsupported Media Type error. I’ve tried various things such as surrounding the text with “”, un-beautifying it etc along with changing options that don’t really make sense, but i’m throwing stuff at the wall and seeing what sticks now!

If I send nothing I get an Request Body is missing so that at least suggests it’ll work if I get the body right.

Thanks

is your ContentType ‘application/json’?

Thanks for your reply - your answer sent me in the right direction.

The ContentType in Postman was showing in the Headers table as application/json as expected, but then I started looking at the code snippets and noticed it was sending a ContentType of ‘app’.

I couldn’t understand why until i scrolled down the Headers table - a bit further down the table, hidden behind the results window, was a second ContentType setting set to ‘app’. I deleted that entry and it’s all working now.

I guess that app entry is either something I’m not yet understanding about Postman or it’s built into the insightVM API Postman Collection that I’m using.