Using Curl and failing...

Started by demilune

demilune

Anyone see what is wrong with this? I get a 400 error.

curl -v -X PUT -H "Content-Type: application/json" -d '{"on":{"value":true}}' IP:16021/api/v1/TOKEN/state

wtf

This works from windows (204 response) for me:

curl -X PUT -H "Content-Type: application/json" -d "{\"value\":true}" IP:16021/api/v1/TOKEN/state/on

demilune

Still fighting this… Now trying to set static colors of each panel. Command below does nothing.

curl -X PUT -H "Content-Type: application/json" -d "{\"command\":\"display\",\"animType\":\"static\",\"animData\":\"3 82 1 255 0 255 0 20 60 1 0 255 255 0 20 118 1 0 0 0 0 20\",\"loop\":false}" IP:16021/api/v1/TOKEN/effects

What am I missing?

wtf

So close! How about:

curl -v -X PUT -H "Content-Type: application/json" -d "{\"write\":{\"command\":\"display\",\"animType\":\"static\",\"animData\":\"3 82 1 255 0 255 0 20 60 1 0 255 255 0 20 118 1 0 0 0 0 20\",\"loop\":false}}" IP:16021/api/v1/TOKEN/effects

The api is whack.

demilune

Thanks @wtf That seemed to work.

Now I need to figure our the animData values. I think I have most of it, but how in the world do you find out what the PanelIDs are?