AnsweredAssumed Answered

UpdateValue error 400 with Python

Question asked by andre.furtado on Oct 26, 2017
Latest reply on Oct 26, 2017 by vkaufmann

Hi guys,

 

I'm trying to insert values to a attribute with Python using PI Web API and requests.

 

def post_data_by_attribute(self, parent_web_id, data):

  url = self._piWebAPI + "streamsets/" + parent_web_id + "/value"
   return self.session.post(url, json = data)

 

data = [{ "WebId": WebId, "Value": {"Timestamp": "2017-10-25T14:00:00Z", "Value": "137"}}]

p = piConnection.post_data_by_attribute(WebId, data)

print(p)

 

And I get <Error 400> as a response. The get requests work fine, only when I'm trying to post data that I'm struggling.

 

Any thoughts on what I may be doing wrong here?

Outcomes