Bond command via http/curl does not work

I got a new Artika Aiden 24 Fandelier with costco and manually added the fan using the commands. However, when trying to rename a few commands I am unable to do so. For example, this if I curl /devices/ , I get a response. However, when I try to list commands, I get 401 unauthorized. This is a fan connected to the Bond Bridge.

Any guidance on how I can make it work ?

curl -H “BOND-Token: xxxxxxxx” -i http://xxx.xxx.xxx.xxx/v2/devices/1433344c4327ef7d

HTTP/1.1 200 OKConnection: close
BOND-Flags: 4Content-Length: 381
Content-Type: application/json; charset=utf-8

{“name”:“Study Fandelier”,“type”:“CF”,“location”:“Office”,“tech”:240,“actions”:[“DecreaseSpeed”,“IncreaseSpeed”,“SetDirection”,“SetSpeed”,“Stop”,“ToggleDirection”,“ToggleLight”,“TogglePower”,“TurnLightOff”,“TurnLightOn”,“TurnOff”,“TurnOn”],““:“185b7070”,”__“:“d83c8ec7”,“commands”:{””:“6ed23cb5”},“state”:{““:“a3152d6c”},“properties”:{””:“69bfa35c”},“skeds”:{“_”:“00000000”}}
kdvlr@linsrv:~/venv$ curl -H “BOND-Token: 7de7b752d435bc3c” -i http://xxx.xxx.xxx.xxx/v2/devices/1433344c4327ef7d/commandsHTTP/1.1 401 UnauthorizedConnection: close 
BOND-Flags: 4
Content-Length: 0

One possibility is those quote characters. Use ascii double quote rather than the unicode directional double quotes.

" is correct, ” is incorrect.

2 Likes

by the way, Artika is now supported in one-click beta, which may be a better option for you. your feedback appreciated

The quote-character point is worth ruling out first: if your shell is passing a curly ” instead of a plain ", the header may not be sent as intended. One quick way to check is to print the request with curl -v and confirm the BOND-Token header looks right. Also note the token in your first command is a different value from the second, so make sure you are reusing the correct one for the device. The 401 specifically suggests the token was not received or not matching, rather than a problem reading the commands path.