is there someone, who can help me out with a hint. I am trying to send a HTTP POST Request to an API from within openHAB. The result should be an Access-Token, that I need to send another POST to control a device.
Within Postmaster I am able to send the Request with: {{url}}/api/authorize/access_token
and get a JSON-Response.
I want to make a POST request to access the API of another application running on the same docker server. This application needs the access-token in the Header of a POST request.
You would use it in a rule. No channel involved. The post I cited has an example of using it in a rule. You collect and parse the output from the command as the return result.
Note that it is probably also possible to use the new HTTP v2 binding. I have not tried that. What I’m referring to above is the action.
I then cut the token from the outfile with a JSONPATH-Transformation.
Might not be an elegant solution, but it works perfectly. I use it to control a Digital Signage Display. I can now retire, unretire or push screens to my Digital Signage System via openHAB.