Skip to main content
1-Visitor
July 28, 2014
Question

Add data to an InfoTable (Data Shape) using REST

  • July 28, 2014
  • 1 reply
  • 4447 views

Is it possible to add rows to a things Infotable using REST? if it is can you please provide an example


The URL of the Thing/infotable is 



The columns of the table are valueHex, time, signal, station


But if I call:



I'm not sure how to construct a row of the table to add - Any sugestions?



    1 reply

    5-Regular Member
    July 28, 2014

    Hi Graham,

    You were close with your first API call, but since the property is an infotable, the value you pass in will be a JSON object. If you run the service in composer with the developer tools open, on the Network tab, you can see what is being passed into the property under Request Payload. Below is an example URL I used to do this. The JSON object must have the datashape defined.


    https://SERVER/Thingworx/Things/TestTable/Properties/modemData?method=put&value={"dataShape":{"fieldDefinitions":{"valueHex":{"name":"valueHex","description":"","baseType":"STRING","ordinal":1,"aspects":{}},"time":{"name":"time","description":"","baseType":"STRING","ordinal":2,"aspects":{}},"station":{"name":"station","description":"","baseType":"STRING","ordinal":4,"aspects":{}},"signal":{"name":"signal","description":"","baseType":"STRING","ordinal":3,"aspects":{}}}},"rows":[{"valueHex":"30","time":"30","station":"30","signal":"30"}]}



    grahamall1-VisitorAuthor
    1-Visitor
    July 28, 2014

    SaeedMa

    Thank you for your help but the code you have provided overwrites the infotable is is possible to append data?




    5-Regular Member
    July 28, 2014

    Hi Graham,

    If you want to add a row, you will need to pass the entire InfoTable along with the row you've added.