Hi,
I have ran into a particular problem with using Set State, Set States, Cycle, Activate Scene.
It only seems to work on the webpage, but does not execute with POSTJSON.
(Working when I go to http://api.developer.lifx.com/docs/set-state & Fill in the values in “Try It Out”)
I can get the following to work on webpage and via https POST JSON:
Toggle Power
Breathe Effect
Pulse Effect
DO NOT WORK:
Set State
Set States
Cycle
Activate Scene
List Scenes
List Lights
Example of a working command (Pulse)
curl -k -H “Authorization: Bearer XXXX” -H “Content-Type: application/json” -X POST -d ‘{“color”:“Blue”,“from_color”:“Green”,“period”:0.5,“cycles”:10,“persist”:false,“power_on”:true,“peak”:".25"}’ “https://api.lifx.com/v1/lights/label:XXX/effects/pulse”
Example of a NON WORKING commands (Set State, Activate Scene & List Scene)
curl -k -H “Authorization: Bearer XXXX” -H “Content-Type: application/json” -X POST -d ‘{“power”:“on”,“color”:“Red”,“brightness”:1,“duration”:2}’ “https://api.lifx.com/v1/lights/all/state”
(I have also tried changing selector to “label:XXX” and “all”, still does not work)
curl -k -H “Authorization: Bearer XXXX” -H “Content-Type: application/json” -X POST -d ‘{“duration”:5}’ “https://api.lifx.com/v1/scenes/scene_id:XXX/activate”
curl -k -H “Authorization: Bearer XXXX” -H “Content-Type: application/json” -X POST -d ‘{}’ “https://api.lifx.com/v1/scenes”
I get a 404 error for all.
Can anyone point me to the right direction on how I can get all commands to work just like they work on the API “Try It Out” webpages.