LIFX Developer Zone

HTTP API Documentation needs more examples


Responding to the OP about the HTTP API - Can we get more example code on there? On the Authentication page you have example code in cURL PHP and Python which is great, but the rest of the documentation has very little in the way of example code.

A Penny for Your Thoughts

Sure, we used to have Perl, PHP and cURL examples for everything, but they got lost when we switched from v1beta1 to v1. I’ll make sure that we move them all across. Is there any example in particular that you are after?


I imagine I’ll be using all of the endpoints eventually, and I am using cURL in PHP so that’s my preference, cheers.


Okay so I’ve added examples to all the pages except Set States and Cycle. I’ll get to the two missing ones next week, they need a bit more finesse. It’ll even substitute your auth token into the code so for almost all the examples you should be able to simply copy + paste the code once you have added your token and refreshed. :smiley:

I haven’t written proper PHP in like 5 years now so I’d really appreciate it if someone could check over them to see if I’m doing it right.

@abrythenabry Am I on the right track towards what you asked for?


That looks great! I’m sure this info will be of use to a lot of people. I’ll let you know if I come up against anything


Hey @daniel_hall did you ever get around to doing the set_states PHP example?


Responded in another thread.