cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Problems with WSEMS and posting REST API calls.

mkoumplis
3-Visitor

Problems with WSEMS and posting REST API calls.

Hi everyone,

I am having trouble managing to set multiple properties of a single thing on the platform with one single REST call. I am using CURL to manually send the REST call, pointing to WSEMS which is running on the same machine. When I try something like that:

curl -vvv -X PUT --data '{"histogram0":572,"histogram1":243}' -H "Content-Type:application/json" http://localhost:8000/Thingworx/Things/Sensor001/Properties/histogram1

it only updates the histogram1 property and not the histogram0 one as well, as included in the JSON. If I try omitting histogram1 from the URI, it gives me an error. Is it not possible to update more than one property at a time with one REST call in this way, or would I need to call the UpdatePropertyValues service from my REST call like so?

curl -vvv -X PUT --data '{"name":"histogram0","value":572,"timestamp":150000000,"quality":"GOOD"}' -H "Content-Type:application/json" http://localhost:8000/Thingworx/Things/Sensor001/Services/UpdatePropertyValues

Here, just as a first step, I only give it one property update. However, the above doesn't seem to work either. Can anyone share their wisdom regarding this?

1 REPLY 1
supandey
19-Tanzanite
(To:mkoumplis)

Hi Marios, in your first REST call, not sure if its complete, but you seem to be updating only histogram1 property as your REST call is only setting /Sensor001/Properties/histogram1 i think this is why you also get error when you only try to update hsitogram0 with that call. Did you try switching it to "*"

Something like .../Sensor001/Properties/*


What exact error do you receive for 2nd REST call? Could suggest to use Postman to formulate right REST calls, makes debugging easier


Edit:


Not sure if you have already seen this, but there are some nice explanation and examples in this blog REST API Overview and Examples

Top Tags