Skip to main content
1-Visitor
October 5, 2016
Solved

ThingWorx REST api questions

  • October 5, 2016
  • 1 reply
  • 2158 views

Hi all,

I've a couple of questions regarding Thx REST API. We're using it for displaying an inventory view in an external webserver.

- Is it possible to select the attributes returned when getting the things implementing a custom pattern? (i.e.: GET Thingworx/ThingTemplates/MyTemplate/ImplementingThings/)

- Is there any option to receive the result paginated or to set any pagination options?

Thanks!

Best answer by ptc-6292103

I would recommend a wrapper service to provide what you need.

Instead of calling Thingworx/ThingTemplates/MyTemplate/ImplementedThings, you would call Thingworx/Things/MyServiceWrapper/Services/GetMyTemplateImplementedThings

There, your service script would accept arguments for the attributes and patterns you want. You can also implement pagination in your service, as Thingworx doesn't seem to provide pagination itself.

1 reply

1-Visitor
October 6, 2016

I would recommend a wrapper service to provide what you need.

Instead of calling Thingworx/ThingTemplates/MyTemplate/ImplementedThings, you would call Thingworx/Things/MyServiceWrapper/Services/GetMyTemplateImplementedThings

There, your service script would accept arguments for the attributes and patterns you want. You can also implement pagination in your service, as Thingworx doesn't seem to provide pagination itself.

1-Visitor
October 7, 2016

Thanks Hatcher, we'll proceed that way