WebComponent (Get, Post, Put) and LIFX

Hi there,

A while ago, I’ve bought 2 LifX (smartlight) bulbs.
Since they have an open HTTP API, I wanted to test this, by using MIT APP Inventor.

On their developpers site, they have several commands that can be tested (Get, Post and Put) as seen in the screenshot.

When I execute a command, I get a respons from the server.
So I was trying to replicate this simple command (GET ListLights) in MIT APP Inventor as seen

But when I push the button, I get an “Error 1101” on the emulator version.
So I build the App by scanning the QR code and try testing it on my Phone.
So there I got the message “Error: Token required”.

So I was wondering, what’s wrong with these simple blocks ?
URL was provided and “Authorization” along with it’s value, as a HeaderRequest.

Also tried it with “ThingSpeak”, and I also get an output there.

So is it the blocks ?
Anyone any ideas on this ?

You didn’t include all the headers?
You have Bearer xxxxxxxxxx in single quotes ?

No, didn’t include all the headers, I’ve tried that too.

Tried it in POSTMAN as well and got a respons, by only submitting the “Authorization” header, without the rest.

And about the quotes…tried with single, double, without,…nothing seems to work.

Thx for replying @TIMAI2, but got it to work in the meantime.

Tried it without the quotes but only through “Connect / AI Compagnion”, without using the Emulator.
That resolves the “Error 1101” and “Token required” problems.

Might just be the emulator is not capable of handling the request. Glad you got it sorted :+1:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.