REST API calls
I'm trying to do a Python rest API call for the Thingworx service 'AddStreamEntry'. But i'm facing issues while passing the infotable in payload.
val = {"rows": [{"PropertyName": "NP", "ThingName": "Coffee3", "Date": "2020-11-27T10:00:00"}], "dataShape": {"fieldDefinitions": {"PropertyName": {"name": "PropertyName", "aspects": {}, "description": "", "baseType": "STRING", "ordinal": 0}, "ThingName": {"name": "ThingName", "aspects": {}, "description": "", "baseType": "STRING", "ordinal": 0}, "Date": {"name": "Date", "aspects": {}, "description": "", "baseType": "DATETIME", "ordinal": 0}}}}
url = '*****/services/AddStreamEntryNP'
payload = {
'values': val
}
getreq = requests.post(url,data=payload, headers=headers)
print(getreq)
Thingworx Java code :
result = me.AddStreamEntry({
sourceType: 'Python' /* STRING */,
values: values /* INFOTABLE */,
location: loc /* LOCATION */,
source: 'Python' /* STRING */,
tags: undefined /* TAGS */,
timestamp: timestamp /* DATETIME */
});
But getting error code 500.
Could someone help me with some way.

