Skip to main content
1-Visitor
May 28, 2019
Question

No changes can be seen in the QueryPropertyHistory using Value Stream and REST API Put Request

  • May 28, 2019
  • 8 replies
  • 5771 views

Hello everyone,

 

I am using Value stream on ThingWorx Server and sending PUT requests (using REST API) setting the properties values and eventually visualizing the changes using mashups.

 

This feature works well when I change the properties value manually from the ThingWorx server, as it is mentioned in this training. However, when I send the PUT requests using Postman client or Python scripts with REST API, the properties values get updated successfully but the value changes can not be seen with the QueryPropertyHistory Service. It should be also noted that for sending the PUT request with Postman and Python scripts, I should send the request multiple times. In the first efforts I get the error message "500 Internal Server Error" before the request sent successfully getting the message "200 OK". Please refer to the attachments for python script and a screenshot from Postman client. 

 

Just before sending this post, I used the suggested Restlet Client sending PUT request and I noticed that not only the value changes can be seen in the QueryPropertyHistory Service table, but also after the first attempt the request sent with message "200 OK", without any "500 Internal Server Error". Then, I tried again to send the request by Postman client and the Python scripts and now I only receive the "500 Internal Server Error" message. I also compared the headers in the Reslet and the other clients but I didn't see any differences. A screenshot from the Restlet Client request can be seen in the attachments.

 

I would be grateful if anyone could help me on this issue. 

 

8 replies

22-Sapphire I
May 29, 2019

Are you at all running into a permission problem? What permissions does the account have that you are using with your rest call?

If it isn't admin, one common issue is that visibility wasn't granted to the 'Persistence Provider'

Also what errors if any are listed in the application log?

iman1-VisitorAuthor
1-Visitor
May 29, 2019

I am not sure if the problem is from the Permission. Actually, I have granted the visibility permission to "Everyone". I also tried with granting different visibility permissions, but didn't help.

 

Another point that might be interesting for you: When I send the put request for changing values of two properties, the value of only one of the properties changes and the Error 500 is received. However, that change cannot be seen in the QueryPropertyHistory as well.

22-Sapphire I
May 29, 2019

What messages do you see in the Application log?