Skip to main content
1-Visitor
August 11, 2016
Question

Getting results of a Service (infotable) using REST API

  • August 11, 2016
  • 2 replies
  • 2723 views

Hi,

I have a requirement to get the output of a query result (infotable) in JSON or text format.

I have a parameter to pass to execute this Service.

How can I achieve this using REST APIs?

Appreciate your help with this.

TIA

Saby

2 replies

5-Regular Member
August 12, 2016

Sorry, are you trying to create services via the REST API? That would be complicated. Any custom services can be accessed via REST API as a POST request. You just need to write a custom service for this. There are snippets in the service editor that help you convert from JSON to infotable and vice versa.

Here is some documentation on it: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS179012

Hope this helps!

Tori

sgobi1-VisitorAuthor
1-Visitor
August 12, 2016

Hi Tori,

I think you got it wrong,

I have a Service in a Database Thing. The Service requires an input parameter.

I want to get the results of the Service (which is in infotable format) using GET method.

Thanks

5-Regular Member
August 15, 2016

All of our services use the POST method in ThingWorx, with very few exceptions. There is an overview on using the ThingWorx REST API here: https://community.thingworx.com/community/developers/blog/2016/06/15/rest-api-overview-and-examples?&art_lang=en&posno=1…

I am not sure why it should matter where this service is located. What is the service doing? Where are you calling it from?