Broker UID - How to get retrieve?

I have been trying to automatically add the switches to OpenHAB for that I have been exploring the RESTful support from OpenHAB.

In the JSON configuration, seems one of the data to be provided is the Bridge ID (Which is the broker UID). Can someone help me on how to retrieve the Broker UID for the same.

One way I was thinking about is to get the entire thing (GET thing) and parse the JSON Object array for the Broker information. This seems to be pretty good work for me.

Hence would like to explore if there is any other alternative. I am not in preference to hardcode the broker information to the code, so that it would work seamlessly with various other OpenHAB installations as well.

Any thoughts / support would be highly appriciated

I don’t see why you couldn’t retrieve all Things, and search through them for any mqtt:broker types. (Guessing you are talking about MQTT)

Don’t forget it is allowed to configure more than one broker, you may need a way to choose the one you are interested in.

Thank you for the reply. The challenge is not the technical feasibility, but I am very new to Web application development. Hence was trying to know if there is an easy workaround for the same