openHAB REST API and Android App Beacon Scanner

Dear Community,

I want to use bluetooth beacons for indoor localization. On my Android phone I got the app Beacon Scanner. This app is able to store an endpoint for logging, i.e. all 30 seconds I got the distance between my android device and the bluetooth beacon. Now, I want to use this functionality to communicate to openHAB REST API.

Anyway I got no idea what endpoint I need to pick, because I did not know if there is a “generic” REST PUT endpoint, which will trigger a corresponding rule and make the incoming JSON string readable in this rule - how do I achieve this goal? Thanks in advance.

Best regards,
Jochen

One approach you could take is to create a custom REST endpoint in openHAB that would receive the JSON string sent by the Beacon Scanner app, and trigger a corresponding rule to process the data. You can find more information on how to create custom REST endpoints in the openHAB documentation.

Couldn’t you define an item of type String, then use the /items endpoint in the REST API to POST the JSON object to that item? Then set your rule up to trigger on the item.

Once you have the item and rule(s) set up, you can test it out using the API Explorer in Main UI.