The error actually already making me questioning whether call sign is an array (list object). And turns out yes it is. I googled the API and found it here :
https://hampager.de/dokuwiki/doku.php?i ... pisendcall
Call sign and transmitter group is a list. I double check your original tasker command and found out the []. My bad, I ignore these, thinking it is something related to tasker. Should pay attention more when converting the json.
So now, we have to create newList() at the call sign and transmitter.
Code: Select all
message = "1.52";
js = newMapFromValues(
"text", message,
"callSignNames", newList("m0tff"),
"transmitterGroupNames", newList("all"),
"emergency", false);
command = 'curl -H "Content-Type: application/json" -X POST -u "m0tff:Password" -d \'' + toJSON(js, false) + '\' http://hampager.de/api/calls';
The command should contain this.
Code: Select all
curl -H "Content-Type: application/json" -X POST -u "m0tff:Password" -d '{"text":"1.52","callSignNames":["m0tff"],"transmitterGroupNames":["all"],"emergency":false}' http://hampager.de/api/calls
Note the difference is at the [ ]. The http version should be working too if the json is correct already.
Sorry, it should be not so hard actually. I just forgot what I have been using in tasker. It is my typical troubleshooting when creating new flow. And it is thru the case usage like this, I have been learning so much until now.