How to access Input resource by HTTP request?


#1

Dear all, i have successfully get value from resource via http request, such as https://api.thinger.io/v2/users/alvarolb/devices/nodemcu/dht?authorization=xxxx

But how could i control an Input resource, example to turn on/off LED, by sending a HTTP link with any browser?
i tried : https://api.thinger.io/v2/users/alvarolb/devices/nodemcu/LED?authorization=xxxxxx{“in”;true}
it send back 401 unauthorized.

By the way, is there a way to change curl command into http link?

Thank you to all gurus.

Cheers


#2

Hi @thumthum, if you use the device api explorer over a connected device with an input resource (i.e., a led), you can see a curl example for turning on/off it. But basically, you should do a HTTP POST request with a JSON payload. You may need to use Javascript for that.