Thank you J-M-L
After spending a long time trying to get it to work, I am able to change a variable with a ~50 line Python script (the following topic helped a lot: Setting and reading Thing variables via the Python API)
BUT I still did not manage to simply change a variable with 1 or 2 cURL (as I cannot run any code in my external system, just a webhook/cURL), shouldn't that be possible?
1. Get the Auth-Token
The following worked to get the Auto-Token (but I needed to change single to double quotes):
curl --request POST \
--url 'https://api2.arduino.cc/iot/v1/clients/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'grant_type=client_credentials' \
--data 'client_id=YOUR_CLIENT_ID' \
--data 'client_secret=YOUR_SECRET_ID' \
--data 'audience=https://api2.arduino.cc/iot'
2. Pass received Auto-Token to a second cURL to change the variable
I did not get this to work ![]()
Shouldn't this be possible with a cURL, something like:
curl --request PUT 'https://api2.arduino.cc/iot/v2/things/YOUR_THING_ID/properties/YOUR_PROPERTY_ID/publish' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
-d '{"value":17}'
I get the following error message (and I tried all variants of quotes in the last line):
{"id":"xxx","code":"bad_request","status":400,"detail":"failed to decode request body with content type \"application/json\": invalid character 'v' looking for beginning of object key string"}
The background page (Arduino IoT Cloud API) is extremely long, but does not contain a single example. Are there some examples somewhere? Or I might post this in the "Jobs/Projects" section?
Thank you very much for your kind support!
MakerAndy