Question
Get multiple property values (single thing) using REST API
Hi,
I am trying to GET multiple property values of a single THING. I saw posts using POSTMAN, but I'm trying to use Python REST API. I have created 2 items and given them default values. In the below code, I am able to print a single value of the property "item1" which is 20.0. How do I fetch all properties using a single REST API call?
#https://academic.cloud.thingworx.com/Thingworx/Things/testmultiple_/Properties/item1
import json
import requests
url_parts = {'entity': 'Things',
'platform': 'Thingworx',
'Thing_Name':'testmultiple_,
'property': 'item1'}
headers = {'appKey': 'fdb763fc-e369-483b-baa5-8445bd8746ee',
'Accept': 'application/json'}
url_template = 'https://academic.cloud.thingworx.com/{platform}/{entity}/{Thing_Name}/Properties/{property}'
response = requests.get(url_template.format(**url_parts), headers=headers).json()
s = response["rows"][0]["item1"]
print(s)

