[SOLVED] Switching myopenhab.org connection on OH3

All,

I used this script to activate the connection to myopenhab.org:

#!/bin/bash
curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" -d "{
  \"mode\": \"remote\",
  \"baseURL\": \"https://myopenhab.org/\"
}" http://localhost:8080/rest/services/org.openhab.openhabcloud/config

(and deactivate using notification instead of remote to block alexa from access)

since OH3 I get:

{"error":{"message":"Authentication required","http-code":401}}openhabian@homer:/etc/openhab/scripts

Anyone, who can help modifying the above script to succeed?
(@jeshab ): This is originally from you (thread below) - maybe you know how to do it ?

You need to setup and use an API token in OH3 to update a service config

Thank you!
I will give it a try and post the results.

I have a token now, but how to hand this over to the curl expression in the script?

#!/bin/bash
curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" -d "{
  \"mode\": \"remote\",
  \"baseURL\": \"https://myopenhab.org/\"
}" http://<api_token>@localhost:8080/rest/services/org.openhab.openhabcloud/config
1 Like

Awesome. That’s it.
Thank you very much!