IBM BigFix 9.1 REST API Serve in JSON?

Hello,
I’m currently building a mini external webapp using the REST API, and I can’t seem to figure out if the API can serve me JSON instead of XML on demand.
If someone could let me know if there is a header, url param etc I can specify to serve JSON that would be great!

For example: GET servername:52311/api/action/NUM?format=json

Thanks in advance!

AFAIK it’s XML only from the REST API

1 Like

You could convert the XML into JSON and then use it. Part of the reason why the REST API only uses XML is that it actually uses XML internally in many cases.

It would be useful if the REST API could return JSON and have the conversion done server side, but that is not an option currently.

The WebUI is written in Node.js so I would think it would want to use JSON as well, but I have no idea how that works under the hood.

Also, are you aware of the WebUI? It might replace your need to build an external mini webapp.

1 Like

Thanks in advance for the replies.
I just wanted to confirm that in fact I could not extract JSON data.
It’s not a very big deal as the cost of conversion is not very high on my end, it’s more of a convenience factor :smile:

jgstew; I’m not aware of WebUI, as I’m not the admin who runs BF, just a Node Dev lol.
However I will inquire about this, to possibly eliminate duplicate efforts.

Thanks again,

Actually, starting with 9.2.5, there is the ability to return JSON for a specific REST API resource: /api/query

You can add an additional parameter called “output” with a value of “json” such as:

/api/query?output=json&relevance=number%20of%20bes%20computers

8 Likes

Very Good to know!!!

Thanks a bunch

1 Like

Thanks @Aram, good to know. Probably added for the WebUI.

ok thanks i will try this and get back on the forum

thank you

I keep forgetting about this capability. I also wonder if any other API options support JSON

CC: @dpowers1

I know it also works with the clientquery result resource.

WebReports session relevance calls with an output to json rather than just XML would be nice.

This specific call may be hard to return in JSON just because of the format of the data which is needed

1 Like