LIFX Developer Zone

HTTP API multiple setState in chain or synchronous


#1

Hi there, I’ve been playing with the HTTP API and I’m trying to figure out a way to send multiple setState commands and let them execute in synchronous order, i.e. execute one, wait for it to finish (given a duration param) and then execute the next setState.

So far I’ve tried multiple endpoints including /cycle and /lights/states , but I can’t find anything that helps me achieve what I’m looking to do. I’m using postman to send HTTP requests.

Any suggestions?


#2

Hi Erick,

There’s no specific way to send serial requests in a single API request, that’s something that clients can usually perform themselves by chaining API (PUT /state) requests together (as you may have discovered however, the PUT /states endpoint does facilitate parallel actions).

Nick