Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
How do I export the output in JSON format?
We are developing the app[ANDROID APP and IOS APP] with ThingWorx.
I want to export some data from ThingWorx to JSON format.
I do not have a basic knowledge of JSON format.
How do I create a service to get data through the REST API?
Please help me..
You can form a url format like,
<http/https:><host:port>/Thingworx/<entity collection>/<entity>/<characteristic collection>/<characteristic>?<query parameters>
Also refer: http://support.ptc.com/cs/help/thingworx_hc/thingworx_6.0_hc/index.jspx?id=thingworx10&action=show
Thanks.
Thanks
If i simply specify the output format of a ThingWorx service, would you use the REST API to get the value elsewhere?
Using like following code
result =
"{" +
"name:" + me.name + "," +
"value:" + me.property +
"}";
I make service
and execute service with api
but result is Invalid Request..
what's wrong?
Output base type is JSON
Try to use,
var params = { infoTableName: undefined /* STRING */ }; // table: INFOTABLE var table = Resources["InfoTableFunctions"].CreateInfoTable(params) table.AddField({name: "ColNameOne", baseType: "STRING"}); table.AddField({name: "ColNameTwo", baseType: "STRING"}); table.AddRow({ ColNameOne : "NAME_DATA", ColNameTwo : "VALUE_DATA", }); var params = { table: table /* INFOTABLE */ }; // table: JSON var result = Resources["InfoTableFunctions"].ToJSON(params);
Thanks.
now result is showing like pictures
and i test API following URL
but REST API return invalid request
request API URL isn't wrong?
It returns the ThingWorx service definition instead of JSON when attempting with the following URL:
Can not get value in the following general JSON form?
{
"name": ThingName,
"value": PropertyValue
}
Postman test results.
I'm hopeless ...
Why does not it print in JSON format?