Add new item using REST

(Huynh Thanh Tu) #1

I want to use REST to create new Item on openHAB. i used openhab 1.8.2 and i find that we can use REST link : curl -X PUT --header “Content-Type: application/json” --header “Accept: application/json” -d "test
" “http://localhost:8080/rest/items/test
and i recieved nothing when i run this command on my linux terminal. Please show me the method use REST to create new item. THanks.

(Rich Koshak) #2

You cannot create a new Item through the REST API in OH 1.8.x

(Huynh Thanh Tu) #3

HABMIN can add new item in webpage, how they can do that? Can i use HTML or Javascript to add a new item. My application require to add new item on the web. Thanks.

(Rich Koshak) #4

Habmin edits the .items file.

(Dana) #5

Is it possible in OH2 Rest API?

(Rich Koshak) #6

See the REST API documentation. I think it is possible. You can install the REST API docs through PaperUI under the Misc tab.

(Dana) #7

Found this. But it doesn’t work like it should.

An Example i’ve tried you can found here.