How to re-format the REST API call to match this format?
The documentation above mentions:
" The openHAB REST API is excellently documented with detailled use instructions. It would vastly exceed this space to present all possible examples. Nevertheless, here is some examples using curl (opens new window), a common command line tool available for many platforms:"
The API is well documented and you can even interact with the API from the docs to see how it works (or make some changes to your OH config if you want).
You don’t. That’s not how it works. The service that implements the API (i.e. openHAB) dictates what the call needs to look like. You’ve two problems here.
It uses basic auth. That’s off by default but you can turn it on in MainUI through Settings → Security (I think, something like that).
It’s using an HTTP GET and openHAB requires an HTTP PUT or HTTP POST to update an Item.
Note, I’m assuming the SetMotionDetect.cgi?... part of the URL in the docs is for example and not required. Otherwise you are never going to get this to work without writing something else outside of OH to receive these calls.
To deal with 2, there are two unofficial ways to handle it. The first is to install ClassicUI and use http://IP:8080/classicui/CMD?LupusMotionDetector=ON (note that only commands are supported).
Or there is an unofficial add-on posted somewhere here on the forum (I can’t find it at the moment) that adds an HTTP GET end point that lets you command or update Items. If you search you should be able to find it.