How does one Edit an InfoTable via Thingworx API?
- January 25, 2022
- 1 reply
- 1453 views
Hello! I've been learning how to work with the REST API in Thingworx. For the most part, it's been relatively easy, but working with InfoTables has been a pain. I've been aiming to try to edit an InfoTable, but it's not been going so well. I've tried multiple variations on formatting, but even sending back the exact same JSON as I received from the GET request failed with a 400 error code (Invalid Invocation Request), saying the query below, which is what I'm attempting to send, is not formatted correctly. I've also tried this same exact query just without the "{testInfoTable: XXX}" as well with the same error. Is there some ordering issue I'm having? I've checked with a JSON parser, and I know for sure it's valid JSON, but for whatever reason, doing a POST with this exact query doesn't work. And again, to be clear, this is the exact output I get when do a GET on this exact table. Likewise, any edits have also failed. I've done this in reference to the image I found within PTC documentation (attached). Can anyone give clarity? Thanks in advance! 🙂
{"testInfoTable":{"rows":[{"Fizz":1234,"CatFish":true,"Salmon":"Fishy"},{"Fizz":9876,"CatFish":true,"Salmon":"Castle"}],"dataShape":{"fieldDefinitions":{"Fizz":{"name":"Fizz","aspects":{"isPrimaryKey":false},"description":"","baseType":"INTEGER","ordinal":1},"CatFish":{"name":"CatFish","aspects":{"isPrimaryKey":false},"description":"","baseType":"BOOLEAN","ordinal":3},"Salmon":{"name":"Salmon","aspects":{"isPrimaryKey":false},"description":"","baseType":"STRING","ordinal":2}}}}}

